index.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <!DOCTYPE html>
  2. <!-- saved from url=(0023)http://www.taffydb.com/ -->
  3. <html lang="en" class="gr__taffydb_com"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  4. <title>TaffyDB - The JavaScript Database</title>
  5. <meta name="description" content="">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta name="description" content="">
  8. <meta name="author" content="">
  9. <script id="twitter-wjs" src="./index_files/widgets.js.download"></script><script type="text/javascript" async="" src="./index_files/ga.js.download"></script><script type="text/javascript" src="./index_files/XRegExp.js.download"></script> <!-- XRegExp is bundled with the final shCore.js during build -->
  10. <script type="text/javascript" src="./index_files/shCore.js.download"></script>
  11. <script type="text/javascript" src="./index_files/shBrushJScript.js.download"></script>
  12. <link type="text/css" rel="stylesheet" href="./index_files/shCore.css">
  13. <link type="text/css" rel="Stylesheet" href="./index_files/shThemeDefault.css">
  14. <script type="text/javascript">SyntaxHighlighter.all();</script>
  15. <!-- Le styles -->
  16. <link href="./index_files/bootstrap.css" rel="stylesheet">
  17. <style type="text/css">
  18. body {
  19. padding-top: 60px;
  20. padding-bottom: 40px;
  21. }
  22. .sidebar-nav {
  23. padding: 9px 0;
  24. }
  25. .toolbar {
  26. opacity:0;
  27. }
  28. .method {
  29. }
  30. .method td {
  31. border-bottom:thin solid silver;
  32. border-top:thin solid silver;
  33. vertical-align:text-top;
  34. }
  35. .method td:first-child {
  36. color:gray;
  37. background-color:#F2EDEF;
  38. font-size:160%;
  39. text-align:center;
  40. vertical-align:middle;
  41. }
  42. b {
  43. background-color:#F2EDEF;
  44. }
  45. </style>
  46. <link href="./index_files/bootstrap-responsive.css" rel="stylesheet">
  47. <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
  48. <!--[if lt IE 9]>
  49. <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  50. <![endif]-->
  51. <!-- Le fav and touch icons -->
  52. <link rel="shortcut icon" href="http://www.taffydb.com/ico/favicon.ico">
  53. <link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://www.taffydb.com/ico/apple-touch-icon-144-precomposed.png">
  54. <link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://www.taffydb.com/ico/apple-touch-icon-114-precomposed.png">
  55. <link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://www.taffydb.com/ico/apple-touch-icon-72-precomposed.png">
  56. <link rel="apple-touch-icon-precomposed" href="http://www.taffydb.com/ico/apple-touch-icon-57-precomposed.png">
  57. <script type="text/javascript">
  58. var _gaq = _gaq || [];
  59. _gaq.push(['_setAccount', 'UA-130587-11']);
  60. _gaq.push(['_trackPageview']);
  61. (function() {
  62. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  63. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  64. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  65. })();
  66. </script>
  67. <script type="text/javascript" charset="utf-8" async="" src="./index_files/timeline.619317855a58aa2366562a395f9e40ef.js.download"></script></head>
  68. <body data-gr-c-s-loaded="true">
  69. <div class="navbar navbar-fixed-top">
  70. <div class="navbar-inner">
  71. <div class="container-fluid">
  72. <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
  73. <span class="icon-bar"></span>
  74. <span class="icon-bar"></span>
  75. <span class="icon-bar"></span>
  76. </a>
  77. <a class="brand" href="/">TaffyDB</a>
  78. <div class="pull-right">
  79. <a class="btn" href="https://github.com/typicaljoe/taffydb">
  80. taffy.js
  81. </a>
  82. </div>
  83. <div class="nav-collapse">
  84. <ul class="nav">
  85. <li class="active"><a href="/">Home</a></li>
  86. <li><a href="https://github.com/typicaljoe/taffydb/archive/master.zip">Download</a></li>
  87. <li><a href="/beginner.html">Beginner's Guide</a></li>
  88. <li><a href="/writing_queries.html">Writing Queries</a></li>
  89. <li><a href="/working_with_data.html">Working With Data</a></li>
  90. <li><a href="extentions.html">Extensions</a></li>
  91. </ul>
  92. </div><!--/.nav-collapse -->
  93. </div>
  94. </div>
  95. </div>
  96. <div class="container-fluid">
  97. <div class="row-fluid">
  98. <div class="span3">
  99. <div class="well sidebar-nav">
  100. <ul class="nav nav-list">
  101. <li class="nav-header">On Github</li>
  102. <li><a href="https://github.com/typicaljoe/taffydb">GitHub Home</a></li>
  103. <li><a href="https://github.com/typicaljoe/taffydb/archive/master.zip">Download</a></li>
  104. <li><a href="https://github.com/typicaljoe/taffydb/blob/master/taffy.js">Source Code</a></li>
  105. <form id="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
  106. <input type="hidden" name="cmd" value="_s-xclick">
  107. <input type="hidden" name="hosted_button_id" value="ENS2E6Z99PDZN">
  108. </form>
  109. <li class="nav-header">Community and Support</li>
  110. <li><a href="https://github.com/typicaljoe/taffydb/issues?state=open">Open Issues</a></li>
  111. <li><a href="#" onclick="document.getElementById('paypal').submit()">Donate</a>
  112. </li>
  113. <li class="nav-header">Created by</li>
  114. <iframe id="twitter-widget-0" scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" class="twitter-timeline twitter-timeline-rendered" style="position: static; visibility: visible; display: inline-block; width: 520px; height: 600px; padding: 0px; border: none; max-width: 100%; min-width: 180px; margin-top: 0px; margin-bottom: 0px; min-height: 200px;" data-widget-id="249607754170368000" title="Twitter Timeline" src="./index_files/saved_resource.html"></iframe>
  115. <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
  116. </ul>
  117. </div><!--/.well -->
  118. </div><!--/span-->
  119. <div class="span9">
  120. <div class="hero-unit">
  121. <h1>The JavaScript Database</h1>
  122. <p>An opensouce library that brings database features into your JavaScript applications.</p>
  123. <h2>Introduction</h2>
  124. <p>How you ever noticed how JavaScript object literals look a lot like records? And that if you wrap a group of them up in an array you have something that looks a lot like a database table? TaffyDB is a libary to bring powerful database funtionality to that concept and rapidly improve the way you work with data inside of JavaScript.</p>
  125. <h2>What makes it sticky</h2>
  126. <ul>
  127. <li>Small file size, extremely fast queries</li>
  128. <li>Powerful JavaScript centric data selection engine</li>
  129. <li>Database inspired features such as count, update, and insert</li>
  130. <li>Robust cross browser support</li>
  131. <li>Easily extended with your own functions</li>
  132. <li>Compatible with any DOM library (jQuery, YUI, Dojo, etc)</li>
  133. <li>Compatible with Server Side JS</li>
  134. </ul>
  135. <h2>Create a Database</h2>
  136. <pre class="brush: js">// Create DB and fill it with records
  137. var friends = TAFFY([
  138. {"id":1,"gender":"M","first":"John","last":"Smith","city":"Seattle, WA","status":"Active"},
  139. {"id":2,"gender":"F","first":"Kelly","last":"Ruth","city":"Dallas, TX","status":"Active"},
  140. {"id":3,"gender":"M","first":"Jeff","last":"Stevenson","city":"Washington, D.C.","status":"Active"},
  141. {"id":4,"gender":"F","first":"Jennifer","last":"Gill","city":"Seattle, WA","status":"Active"}
  142. ]);
  143. </pre>
  144. <h2>Filter using the database name and object comparison</h2>
  145. <pre class="brush: js">// Find all the friends in Seattle
  146. friends({city:"Seattle, WA"});
  147. // Find John Smith, by ID
  148. friends({id:1});
  149. // Find John Smith, by Name
  150. friends({first:"John",last:"Smith"});
  151. </pre>
  152. <h2>Access data easily</h2>
  153. <pre class="brush: js">// Kelly's record
  154. var kelly = friends({id:2}).first();
  155. // Kelly's last name
  156. var kellyslastname = kelly.last;
  157. // Get an array of record ids
  158. var cities = friends().select("id");
  159. // Get an array of distinct cities
  160. var cities = friends().distinct("city");
  161. // Apply a function to all the male friends
  162. friends({gender:"M"}).each(function (r) {
  163. alert(r.name + "!");
  164. });
  165. </pre>
  166. <h2>Modify data on the fly</h2>
  167. <pre class="brush: js">// Move John Smith to Las Vegas
  168. friends({first:"John",last:"Smith"}).update({city:"Las Vegas, NV:"});
  169. // Remove Jennifer Gill as a friend
  170. friends({id:4}).remove();
  171. // insert a new friend
  172. friends.insert({"id":5,"gender":"F","first":"Jennifer","last":"Gill","city":"Seattle, WA","status":"Active"});
  173. </pre>
  174. <p><a class="btn btn-primary btn-large" href="https://github.com/typicaljoe/taffydb/archive/master.zip">Download »</a></p>
  175. </div>
  176. <footer>
  177. <div class="row-fluid">
  178. <div class="span4">
  179. <h2>Beginner's Guide</h2>
  180. <p>A quick intro to getting your first DB up in running from scratch.</p>
  181. <p><a class="btn" href="/beginner.html">View details »</a></p>
  182. </div><!--/span-->
  183. <div class="span4">
  184. <h2>Writing queries</h2>
  185. <p>The heart of TaffyDB and any database is running queries against your data. This is done after creation of your database by calling the root function and building Filter Objects.</p>
  186. <p><a class="btn" href="/writing_queries.html">View details »</a></p>
  187. </div><!--/span-->
  188. <div class="span4">
  189. <h2>Using and modifying data</h2>
  190. <p>The basics for ordering, inserting, updating, deleting, and using your data in an application.</p>
  191. <p><a class="btn" href="/working_with_data.html">View details »</a></p>
  192. </div><!--/span-->
  193. </div><!--/row-->
  194. <div class="row-fluid">
  195. <div class="span4">
  196. <h2>Extensions</h2>
  197. <p>TaffyDB is easy to extend. Write your own plugins or model whole applications with TaffyDB as the backbone.</p>
  198. <p><a class="btn" href="/working_with_data.html">View details »</a></p>
  199. </div><!--/span-->
  200. <div class="span4">
  201. <h2>Fork It!</h2>
  202. <p>Use and modify the library for your own projects and contribute code back to the master library</p>
  203. <p><a class="btn" href="https://github.com/typicaljoe/taffydb">View details »</a></p>
  204. </div><!--/span-->
  205. </div><!--/row-->
  206. </footer>
  207. </div><!--/span-->
  208. </div><!--/row-->
  209. <hr>
  210. <footer>
  211. <div align="center"><img src="./index_files/taffydbboxV3.jpg"></div>
  212. </footer>
  213. </div><!--/.fluid-container-->
  214. <!-- Le javascript
  215. ================================================== -->
  216. <!-- Placed at the end of the document so the pages load faster -->
  217. <script src="./index_files/jquery.js.download"></script>
  218. <script src="./index_files/bootstrap-transition.js.download"></script>
  219. <script src="./index_files/bootstrap-alert.js.download"></script>
  220. <script src="./index_files/bootstrap-modal.js.download"></script>
  221. <script src="./index_files/bootstrap-dropdown.js.download"></script>
  222. <script src="./index_files/bootstrap-scrollspy.js.download"></script>
  223. <script src="./index_files/bootstrap-tab.js.download"></script>
  224. <script src="./index_files/bootstrap-tooltip.js.download"></script>
  225. <script src="./index_files/bootstrap-popover.js.download"></script>
  226. <script src="./index_files/bootstrap-button.js.download"></script>
  227. <script src="./index_files/bootstrap-collapse.js.download"></script>
  228. <script src="./index_files/bootstrap-carousel.js.download"></script>
  229. <script src="./index_files/bootstrap-typeahead.js.download"></script>
  230. <iframe id="rufous-sandbox" scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" style="position: absolute; visibility: hidden; display: none; width: 0px; height: 0px; padding: 0px; border: none;" title="Twitter analytics iframe" src="./index_files/saved_resource(1).html"></iframe></body></html>