antos-frontend/src/core/db.coffee

13 lines
417 B
CoffeeScript
Raw Normal View History

2018-02-05 19:05:41 +01:00
class DB
constructor: (@table) ->
save: (d, f) ->
_API.handler.dbquery "save", { table: @table, data: d }, f
delete: (id, f) ->
_API.handler.dbquery "delete", { table: @table, id: id }, f
get: (id, f) ->
_API.handler.dbquery "get", { table: @table, id: id }, f
find: (cond, f) ->
_API.handler.dbquery "select", { table: @table, cond: cond }, f
self.OS.API.DB = DB