-
Notifications
You must be signed in to change notification settings - Fork 9
/
examples.html
55 lines (42 loc) · 1.41 KB
/
examples.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<title>localDB Examples</title>
<script type="text/javascript" src="localdb.js"></script>
<script type="text/javascript">
//Loading a database
//var db = new localdb('foo');
//Deleteing a database
//removeDatabase = function(){
// db.deleteDatabase("foo");
//};
//Creating a Table
//db.createTable('users');
//Deleting a Table
//db.dropTable('users');
//Get Table Meta Data
//var meta = db.tableMeta('users');
//Inserting Data
//db.insert('users', {'username': 'john', 'firstname': 'John', 'lastname': 'Smith'});
//Updating Data
//db.update('users', {'username': 'johnny'}, {'username': 'john'});
//db.updateById('users', {'username': 'johnny'}, 42);
//Removing Data
//db.remove('users', {'username': 'john'});
//db.removeById('users', 42);
//Finding Data
//var result = db.find('users', {'username': 'john'});
//var result = db.find('users', {'firstname': 'John'}, 5, 0);
//var result = db.find('users', {'title': 'Mr', 'firstname': 'John'}, 5, 0, 'OR');
//Checking Database Exists
//var dbexists = db.dbExists('bar');
//Checking Table Exists
//var tableexists = db.tableExists('users');
//Exporting Data
//var table = db.exportData('users');
//var database = db.exportData(); d
</script>
</head>
<body>
</body>
</html>