Add Ormin ORM support for BaraDB (Nim client)
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import ../../ormin, ../../ormin/serverws, json
|
||||
|
||||
importModel(DbBackend.sqlite, "forum_model")
|
||||
|
||||
var db {.global.} = open("stuff", "", "", "")
|
||||
|
||||
protocol "forumclient.nim":
|
||||
common:
|
||||
when defined(js):
|
||||
type kstring = cstring
|
||||
else:
|
||||
type kstring = string
|
||||
type
|
||||
inetType = kstring
|
||||
varcharType = kstring
|
||||
timestampType = kstring
|
||||
server:
|
||||
query:
|
||||
delete antibot
|
||||
where ip == %arg
|
||||
client:
|
||||
proc deleteAntibot(ip: string)
|
||||
server:
|
||||
query:
|
||||
update session(lastModified = !!"DATETIME('now')")
|
||||
where ip == %arg["ip"] and password == %arg["pw"]
|
||||
client:
|
||||
proc updateSession(arg: Session)
|
||||
server:
|
||||
let allSessions = query:
|
||||
select session(_)
|
||||
send(allSessions)
|
||||
client:
|
||||
type Session = ref object
|
||||
var gSessions: seq[Session]
|
||||
gSessions = recv()
|
||||
proc getAllSessions()
|
||||
Reference in New Issue
Block a user