Advertisement
Guest User

Untitled

a guest
Dec 14th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. Createdb
  2. db.transaction(function(tx) {
  3. tx.executeSql( 'CREATE TABLE IF NOT EXISTS Connections ( \
  4. id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, \
  5. connection_name TEXT NOT NULL, \
  6. username TEXT NOT NULL, \
  7. address VARCHAR(255) NOT NULL, \
  8. type TEXT NOT NULL, \
  9. category TEXT NOT NULL, \
  10. act_on_start BOOL NOT NULL, \
  11. connection_commands VARCHAR(255) \
  12. );' );
  13. })
  14. }
  15.  
  16. Add con
  17. function createConnection(name,username,address,type,category,aos,commands){
  18.  
  19. var db = getDBase();
  20.  
  21. db.transaction(function(tx){
  22. tx.executeSql('INSERT INTO Connections (connection_name, username,address, type, \
  23. category,act_on_start, connection_commands) VALUES (?,?,?,?,?,?,?);', [name,username,address,type,category,aos,commands]);
  24. })
  25.  
  26. }
  27.  
  28. Remove con
  29. function removeConnection(id,name,username,address,type,category,aos,commands){
  30.  
  31. var db = getDBase();
  32.  
  33. db.transaction(function(tx) {
  34. tx.executeSql('DELETE FROM Connections WHERE id=? AND connection_name=? AND username=? AND address=? \
  35. AND type=? AND category=? AND act_on_start=? AND connection_commands=?', [id,name,username,address,type,category,aos,commands]);
  36. })
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement