alvarofelipems / orm-html5 Goto Github PK
View Code? Open in Web Editor NEWThis project forked from jmrobles/orm-html5
ORM for JavaScript objects using HTML5 DB feature
License: GNU Lesser General Public License v3.0
This project forked from jmrobles/orm-html5
ORM for JavaScript objects using HTML5 DB feature
License: GNU Lesser General Public License v3.0
Object-Relational mapping for Web SQL is a LGPL JavaScript? library that allows you develop easily rich database Internet apps using the ORM paradigm. ORM HTML5 is inspired by Django model. How to? 1. Include "orm.js" <script language="JavaScript" src="orm.js"></script> 2. Define your models <script language="JavaScript"> function Client(db) { this.base = ModelBase; this.base("client"); // Name of table // Specifies the fields: // name: string not null // surname: string // age: integer this.fields = ["snName", "sSurname", "iAge"]; // Preload objects in table this.predata = [ {id:1, name: 'John' , surname: 'Smith', age: 20 }, {id:2, name: 'Ana' , surname: 'Castillo', age: null} ]; // Initialiaze this.init(db); } // Create DB Manager dbm = new DBM('ERP'); // Register your models dbm.register(['Client']); </script> 3. Use it! <script language="JavaScript"> var c = new Client(dbm); c.name = 'David'; c.surname = 'Lohan'; c.age = '30'; c.save(function (result) { if (result) alert('save ok'); }); </script> How works? ORM-HTML5 use Javascript's reflection and Web SQL API (no needs external libraries). DBM.register() create the tables of models if is necessary. Also loads "preload" data.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.