星期三, 三月 12, 2008

Javascript 的 Database: Taffy DB

Javascript 的 Database 是 一個很酷的 Idea, 但是, 好像又有點怪怪的.....

DB 的空間只有 10K, 這跟直接存在 Cookie 或存成 JS Array 比起來, 似乎沒有比較方便.

不過, 提供的 DB 處理倒是可以省掉不少工(ex: Find / Update / Insert / Remove / OrderBy ... 等). 先記起來, 之後再研究如何應用它~ :)

Javascript Database: Taffy DB : A JavaScript database for your browser

此 Taffy DB Library 的功能/限制

  • Under 10K!
  • Simple, JavaScript Centric Syntax
  • Fast
  • Easy to include in any web application
  • Compatible with major Ajax libraries: YUI, JQuery, Dojo, Prototype, EXT, etc
  • CRUD Interface (Create, Read, Update, Delete)
  • Sorting
  • Looping
  • Advanced Queries

Taffy DB 的 CRUD

  • Insert: friends.insert({name:"Brian", gender:"M", married:"No", age:52, state:"FL", favorite_foods:["fruit","steak"]});
  • Select: friends.find({state:["WA","MT","ID"], age:{less:50}}, [0,2]);
  • Update: friends.update({state:"CA", married:"Yes"}, {name:"Joyce"});
  • Delete: friends.remove({name:"Brian"});
  • OrderBy: friends.orderBy(["age", {"name":"asce"}]);
  • 詳細用法可見: Getting Started: Your first bite of Taffy

其它相關網頁

相關標籤
Add this page to del.icio.us Add this page to Yahoo Taiwan's bookmark Add this page to MyShare

發表迴響

標題

內容 (限制 1000 字)

暱稱

電子郵件

個人網頁


 authimage


PS: 若無法留言, 請先確認是否有打開 JavaScript, 造成您的困擾, 實在萬分對不起 Orz...(如果無法留言, 勞煩可以發信給我好嗎? 謝謝.)
PS2: 若您的留言被誤判, 我都會再自行看過, 不需要一直重覆張貼~