fixes #250
This commit is contained in:
parent
db80038c37
commit
14fc0631d7
11 changed files with 62 additions and 22 deletions
|
|
@ -34,8 +34,8 @@ type
|
|||
TDbConn* = TMongo ## a database connection; alias for ``TMongo``
|
||||
|
||||
FDb* = object of FIO ## effect that denotes a database operation
|
||||
FReadDb* = object of FReadIO ## effect that denotes a read operation
|
||||
FWriteDb* = object of FWriteIO ## effect that denotes a write operation
|
||||
FReadDb* = object of FDB ## effect that denotes a read operation
|
||||
FWriteDb* = object of FDB ## effect that denotes a write operation
|
||||
|
||||
proc dbError*(db: TDbConn, msg: string) {.noreturn.} =
|
||||
## raises an EDb exception with message `msg`.
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ type
|
|||
TSqlQuery* = distinct string ## an SQL query string
|
||||
|
||||
FDb* = object of FIO ## effect that denotes a database operation
|
||||
FReadDb* = object of FReadIO ## effect that denotes a read operation
|
||||
FWriteDb* = object of FWriteIO ## effect that denotes a write operation
|
||||
FReadDb* = object of FDb ## effect that denotes a read operation
|
||||
FWriteDb* = object of FDb ## effect that denotes a write operation
|
||||
|
||||
proc dbError(db: TDbConn) {.noreturn.} =
|
||||
## raises an EDb exception.
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ type
|
|||
TSqlQuery* = distinct string ## an SQL query string
|
||||
|
||||
FDb* = object of FIO ## effect that denotes a database operation
|
||||
FReadDb* = object of FReadIO ## effect that denotes a read operation
|
||||
FWriteDb* = object of FWriteIO ## effect that denotes a write operation
|
||||
FReadDb* = object of FDB ## effect that denotes a read operation
|
||||
FWriteDb* = object of FDB ## effect that denotes a write operation
|
||||
|
||||
proc sql*(query: string): TSqlQuery {.noSideEffect, inline.} =
|
||||
## constructs a TSqlQuery from the string `query`. This is supposed to be
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ type
|
|||
TSqlQuery* = distinct string ## an SQL query string
|
||||
|
||||
FDb* = object of FIO ## effect that denotes a database operation
|
||||
FReadDb* = object of FReadIO ## effect that denotes a read operation
|
||||
FWriteDb* = object of FWriteIO ## effect that denotes a write operation
|
||||
FReadDb* = object of FDB ## effect that denotes a read operation
|
||||
FWriteDb* = object of FDB ## effect that denotes a write operation
|
||||
|
||||
proc sql*(query: string): TSqlQuery {.noSideEffect, inline.} =
|
||||
## constructs a TSqlQuery from the string `query`. This is supposed to be
|
||||
|
|
|
|||
|
|
@ -35,12 +35,13 @@ var
|
|||
c_stderr {.importc: "stderr", noDecl.}: C_TextFileStar
|
||||
|
||||
# constants faked as variables:
|
||||
var
|
||||
SIGINT {.importc: "SIGINT", nodecl.}: cint
|
||||
SIGSEGV {.importc: "SIGSEGV", nodecl.}: cint
|
||||
SIGABRT {.importc: "SIGABRT", nodecl.}: cint
|
||||
SIGFPE {.importc: "SIGFPE", nodecl.}: cint
|
||||
SIGILL {.importc: "SIGILL", nodecl.}: cint
|
||||
when not defined(SIGINT):
|
||||
var
|
||||
SIGINT {.importc: "SIGINT", nodecl.}: cint
|
||||
SIGSEGV {.importc: "SIGSEGV", nodecl.}: cint
|
||||
SIGABRT {.importc: "SIGABRT", nodecl.}: cint
|
||||
SIGFPE {.importc: "SIGFPE", nodecl.}: cint
|
||||
SIGILL {.importc: "SIGILL", nodecl.}: cint
|
||||
|
||||
when defined(macosx):
|
||||
var
|
||||
|
|
@ -95,7 +96,8 @@ proc c_malloc(size: int): pointer {.importc: "malloc", nodecl.}
|
|||
proc c_free(p: pointer) {.importc: "free", nodecl.}
|
||||
proc c_realloc(p: pointer, newsize: int): pointer {.importc: "realloc", nodecl.}
|
||||
|
||||
var errno {.importc, header: "<errno.h>".}: cint ## error variable
|
||||
when not defined(errno):
|
||||
var errno {.importc, header: "<errno.h>".}: cint ## error variable
|
||||
proc strerror(errnum: cint): cstring {.importc, header: "<string.h>".}
|
||||
|
||||
proc c_remove(filename: CString): cint {.importc: "remove", noDecl.}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue