by Roberto on April 17, 2010
in General
If you need to implement a database on client side in Javascript I suggest to consider Taffy DB.
Taffy DB is a small library that can simplify the work a lot when you have to deal with many data structure in Javascript :
Taffy DB is a free and opensource JavaScript library that acts as thin data layer inside Web 2.0 and Ajax applications.
What makes it cool:
- 10K file size!
- 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
Think of it as a SQL database in your web browser.
Example of use :
// Create a table
var friends = new TAFFY([]);
//Insert records in the table
friends.insert(
{name:"Brian",
gender:"M",
married:"No",
age:52,
state:"FL",
favorite_foods:["fruit","steak"]
});
//Update records matching a condition
friends.update(
{
state:"CA",
married:"Yes"
},
friends.find(
{name:"Joyce"}
)
);
//Remove
friends.remove({name:"Brian"});
//Order the records
friends.orderBy(["age",{"name":"desc"}]);
See the getting started guide for documentation and more examples.
I’m using this library in a new Google Gadget I’m writing.
This gadget uses the user’s contacts and I needed an easy way to manage the contacts list on client side using Javascript. Taffy DB is very useful for me in this scenario.
Tagged as:
database,
Javascript
The Roman graphic agency produces a resorts catalog for SudTirol AltaPusteria Valley.
I developed for them 5 years ago a PHP application that permits to collect data from every single resort and export them in a format compatible with Adobe InDesign to create the PDF files necessary to create the paper catalog.
In these months we decided to rebuild the application to add new features and reduce the manual work for creating the catalog, producing the PDF parts with the data of every resort directly from the application.
The web application has been re-written from scratch using Drupal.
Every resort has his own account where it can manages its resorts.
Additional supervisor roles have been created for power users who need to supervise the data entry.
Many features have been developed using Drupal contrib modules, but many others have been custom developed to make the data entry easier.
The web application is multilingual : English, German and Italian.
The most challenging feature has been the creation of high quality PDF to build the paper catalog.
We needed some special features like over printing and precise elements positioning.
After several tests I choose TCPDF library to create the PDF files, due to its completeness of features.
A special feature has been created that permits to compare the data currently collected with data snapshot saved in the past.
A configuration panel permits to the administrators to control the period when the data gathering is allowed, the data snapshot creation and some application specific settings.
Tagged as:
Drupal,
Javascript,
PHP