Index
Modules:
norm/model
,
norm/pool
,
norm/postgres
,
norm/pragmas
,
norm/pragmasutils
,
norm/private/dot
,
norm/private/log
,
norm/private/postgres/dbtypes
,
norm/private/postgres/llexec
,
norm/private/postgres/rowutils
,
norm/private/sqlite/dbtypes
,
norm/private/sqlite/rowutils
,
norm/private/utils
,
norm/sqlite
,
norm/types
.
API symbols
`$`:
types: `$`[T](s: PaddedStringOfCap[T]): string
types: `$`[T](s: StringOfCap[T]): string
`==`:
types: `==`[T](x, y: PaddedStringOfCap[T]): bool
types: `==`[T](x, y: StringOfCap[T]): bool
add:
pool: add[T: DbConn](pool: var Pool; dbConn: T)
checkRo:
model: checkRo(T: typedesc[Model])
close:
pool: close(pool: var Pool)
col:
model: col[T: Model](obj: T; fld: string): string
model: col(T: typedesc[Model]; fld: string): string
cols:
model: cols[T: Model](obj: T; force = false): seq[string]
ConflictPolicy:
model: ConflictPolicy
count:
postgres: count(dbConn; T: typedesc[Model]; col = "*"; dist = false; cond = "TRUE"; params: varargs[DbValue, dbValue]): int64
sqlite: count(dbConn; T: typedesc[Model]; col = "*"; dist = false; cond = "1"; params: varargs[DbValue, dbValue]): int64
cpIgnore:
ConflictPolicy.cpIgnore
cpRaise:
ConflictPolicy.cpRaise
cpReplace:
ConflictPolicy.cpReplace
createSchema:
postgres: createSchema[T: Model](dbConn; obj: T)
sqlite: createSchema[T: Model](dbConn; obj: T)
createTables:
postgres: createTables[T: Model](dbConn; obj: T)
sqlite: createTables[T: Model](dbConn; obj: T)
dbHostEnv:
postgres: dbHostEnv
sqlite: dbHostEnv
dbNameEnv:
postgres: dbNameEnv
dbPassEnv:
postgres: dbPassEnv
dbType:
dbtypes: dbType(T: typedesc[int32 | enum]): string
dbtypes: dbType(T: typedesc[int64 | Positive | int | Natural]): string
dbtypes: dbType(T: typedesc[bool]): string
dbtypes: dbType(T: typedesc[DateTime]): string
dbtypes: dbType(T: typedesc[float32]): string
dbtypes: dbType(T: typedesc[float64]): string
dbtypes: dbType(T: typedesc[int16]): string
dbtypes: dbType(T: typedesc[Model]): string
dbtypes: dbType[T](_: typedesc[Option[T]]): string
dbtypes: dbType[C](_: typedesc[PaddedStringOfCap[C]]): string
dbtypes: dbType(T: typedesc[string]): string
dbtypes: dbType[C](_: typedesc[StringOfCap[C]]): string
dbtypes: dbType(T: typedesc[SomeInteger | enum]): string
dbtypes: dbType(T: typedesc[bool]): string
dbtypes: dbType(T: typedesc[DateTime]): string
dbtypes: dbType(T: typedesc[DbBlob]): string
dbtypes: dbType(T: typedesc[Model]): string
dbtypes: dbType[T](_: typedesc[Option[T]]): string
dbtypes: dbType[C](_: typedesc[PaddedStringOfCap[C]]): string
dbtypes: dbType(T: typedesc[SomeFloat]): string
dbtypes: dbType(T: typedesc[string]): string
dbtypes: dbType[C](_: typedesc[StringOfCap[C]]): string
dbUserEnv:
postgres: dbUserEnv
dbValue:
dbtypes: dbValue(val: typeof(nil)): DbValue
dbtypes: dbValue[T: Model](val: Option[T]): DbValue
dbtypes: dbValue[T](val: PaddedStringOfCap[T]): DbValue
dbtypes: dbValue[T](val: StringOfCap[T]): DbValue
dbtypes: dbValue[T: Model](val: T): DbValue
dbtypes: dbValue(val: typeof(nil)): DbValue
dbtypes: dbValue(val: bool): DbValue
dbtypes: dbValue(val: DateTime): DbValue
dbtypes: dbValue(val: Option[bool]): DbValue
dbtypes: dbValue(val: Option[DateTime]): DbValue
dbtypes: dbValue[T: Model](val: Option[T]): DbValue
dbtypes: dbValue[T](val: PaddedStringOfCap[T]): DbValue
dbtypes: dbValue[T](val: StringOfCap[T]): DbValue
dbtypes: dbValue[T: Model](val: T): DbValue
defaultSize:
pool: defaultSize(pool: Pool): Natural
delete:
postgres: delete[T: Model](dbConn; objs: var openArray[T])
postgres: delete[T: Model](dbConn; obj: var T)
sqlite: delete[T: Model](dbConn; objs: var openArray[T])
sqlite: delete[T: Model](dbConn; obj: var T)
dot:
dot: dot(obj: typed; fld: string): untyped
dropDb:
postgres: dropDb()
sqlite: dropDb()
execExpectTuplesOk:
llexec: execExpectTuplesOk(db: DbConn; query: SqlQuery; args: seq[DbValue])
exists:
postgres: exists(dbConn; T: typedesc[Model]; cond = "TRUE"; params: varargs[DbValue, dbValue]): bool
sqlite: exists(dbConn; T: typedesc[Model]; cond = "1"; params: varargs[DbValue, dbValue]): bool
fCol:
model: fCol[T: Model](obj: T; fld: string): string
model: fCol[T: Model](obj: T; fld, tAls: string): string
model: fCol(T: typedesc[Model]; fld: string): string
model: fCol(T: typedesc[Model]; fld, tAls: string): string
fk:
pragmas: fk(val: typed)
fromRow:
rowutils: fromRow[T: ref object](obj: var T; row: Row)
rowutils: fromRow[T: ref object](obj: var T; row: Row)
getCustomPragmaVal:
pragmasutils: getCustomPragmaVal(n: typed; cp: typed{nkSym}): untyped
getDb:
postgres: getDb(): DbConn
sqlite: getDb(): DbConn
getRelatedFieldNameTo:
model: getRelatedFieldNameTo[S: Model; T: Model](source: typedesc[S]; target: typedesc[T]): string
hasCustomPragma:
pragmasutils: hasCustomPragma(n: typed; cp: typed{nkSym}): untyped
hasField:
dot: hasField(t: typed; fieldName: static string): bool
index:
pragmas: index(val: string)
insert:
postgres: insert[T: Model](dbConn; objs: var openArray[T]; force = false)
postgres: insert[T: Model](dbConn; obj: var T; force = false; conflictPolicy = cpRaise)
sqlite: insert[T: Model](dbConn; objs: var openArray[T]; force = false; conflictPolicy = cpRaise)
sqlite: insert[T: Model](dbConn; obj: var T; force = false; conflictPolicy = cpRaise)
isEmptyColumn:
rowutils: isEmptyColumn(row: Row; index: int): bool
rowutils: isEmptyColumn(row: Row; index: int): bool
isModel:
model: isModel[T: Model](val: Option[T]): bool
model: isModel[T: Model](val: T): bool
model: isModel[T](val: T): bool
isRefObject:
utils: isRefObject[T](val: Option[T]): bool
utils: isRefObject[T](val: T): bool
utils: isRefObject[T](val: typedesc[Option[T]]): bool
utils: isRefObject[T](val: typedesc[T]): bool
joinGroups:
model: joinGroups[T: Model](obj: T; flds: seq[string] = @[]): seq[ tuple[tbl, tAls, lFld, rFld: string]]
log:
log: log(msg: string)
log: log(qry, paramstr: string)
LoggingError:
log: LoggingError
Model:
model: Model
model:
model: model[T: Model](val: Option[T]): Option[T]
model: model[T: Model](val: T): Option[T]
model: model[T](val: T): Option[Model]
newPaddedStringOfCap:
types: newPaddedStringOfCap[C: static[int]](val = ""): PaddedStringOfCap[C]
newPool:
pool: newPool[T: DbConn](defaultSize: Positive; getDbProc: proc (): T = getDb; poolExhaustedPolicy = pepRaise): Pool[T]
newStringOfCap:
types: newStringOfCap[C: static[int]](val = ""): StringOfCap[C]
NotFoundError:
postgres: NotFoundError
sqlite: NotFoundError
onDelete:
pragmas: onDelete(val: string)
PaddedStringOfCap:
types: PaddedStringOfCap
pepExtend:
PoolExhaustedPolicy.pepExtend
pepRaise:
PoolExhaustedPolicy.pepRaise
pk:
pragmas: pk()
Pool:
pool: Pool
PoolExhaustedError:
pool: PoolExhaustedError
PoolExhaustedPolicy:
pool: PoolExhaustedPolicy
pop:
pool: pop[T: DbConn](pool: var Pool[T]): T
rawSelect:
postgres: rawSelect[T: ref object](dbConn; qry: string; objs: var seq[T]; params: varargs[DbValue, dbValue])
postgres: rawSelect[T: ref object](dbConn; qry: string; obj: var T; params: varargs[DbValue, dbValue])
sqlite: rawSelect[T: ref object](dbConn; qry: string; objs: var seq[T]; params: varargs[DbValue, dbValue])
sqlite: rawSelect[T: ref object](dbConn; qry: string; obj: var T; params: varargs[DbValue, dbValue])
readOnly:
pragmas: readOnly()
reset:
pool: reset(pool: var Pool)
rfCols:
model: rfCols[T: Model](obj: T; flds: seq[string] = @[]): seq[string]
ro:
pragmas: ro()
rollback:
postgres: rollback()
sqlite: rollback()
RollbackError:
postgres: RollbackError
sqlite: RollbackError
schema:
model: schema(T: typedesc[Model]): Option[string]
schemaName:
pragmas: schemaName(val: string)
select:
postgres: select[T: Model](dbConn; objs: var seq[T]; cond: string; params: varargs[DbValue, dbValue])
postgres: select[T: Model](dbConn; obj: var T; cond: string; params: varargs[DbValue, dbValue])
sqlite: select[T: Model](dbConn; objs: var seq[T]; cond: string; params: varargs[DbValue, dbValue])
sqlite: select[T: Model](dbConn; obj: var T; cond: string; params: varargs[DbValue, dbValue])
selectAll:
postgres: selectAll[T: Model](dbConn; objs: var seq[T])
sqlite: selectAll[T: Model](dbConn; objs: var seq[T])
selectManyToMany:
postgres: selectManyToMany[M1: Model; J: Model; M2: Model](dbConn; queryStartEntry: M1; joinModelEntries: var seq[J]; queryEndEntries: var seq[M2])
postgres: selectManyToMany[M1: Model; J: Model; M2: Model](dbConn; queryStartEntry: M1; joinModelEntries: var seq[J]; queryEndEntries: var seq[M2]; fkColumnFromJoinToManyStart: static string; fkColumnFromJoinToManyEnd: static string)
postgres: selectManyToMany[M1: Model; J: Model; M2: Model](dbConn; queryStartEntries: seq[M1]; joinModelEntries: var seq[J]; queryEndEntries: var Table[int64, seq[M2]])
postgres: selectManyToMany[M1: Model; J: Model; M2: Model](dbConn; queryStartEntries: seq[M1]; joinModelEntries: var seq[J]; queryEndEntries: var Table[int64, seq[M2]]; fkColumnFromJoinToManyStart: static string; fkColumnFromJoinToManyEnd: static string)
sqlite: selectManyToMany[M1: Model; J: Model; M2: Model](dbConn; queryStartEntry: M1; joinModelEntries: var seq[J]; queryEndEntries: var seq[M2])
sqlite: selectManyToMany[M1: Model; J: Model; M2: Model](dbConn; queryStartEntry: M1; joinModelEntries: var seq[J]; queryEndEntries: var seq[M2]; fkColumnFromJoinToManyStart: static string; fkColumnFromJoinToManyEnd: static string)
sqlite: selectManyToMany[M1: Model; J: Model; M2: Model](dbConn; queryStartEntries: seq[M1]; joinModelEntries: var seq[J]; queryEndEntries: var Table[int64, seq[M2]])
sqlite: selectManyToMany[M1: Model; J: Model; M2: Model](dbConn; queryStartEntries: seq[M1]; joinModelEntries: var seq[J]; queryEndEntries: var Table[int64, seq[M2]]; fkColumnFromJoinToManyStart: static string; fkColumnFromJoinToManyEnd: static string)
selectOneToMany:
postgres: selectOneToMany[O: Model; M: Model](dbConn; oneEntry: O; relatedEntries: var seq[M])
postgres: selectOneToMany[O: Model; M: Model](dbConn; oneEntry: O; relatedEntries: var seq[M]; foreignKeyFieldName: static string)
postgres: selectOneToMany[O: Model; M: Model](dbConn; oneEntries: seq[O]; relatedEntries: var seq[M])
postgres: selectOneToMany[O: Model; M: Model](dbConn; oneEntries: seq[O]; relatedEntries: var Table[int64, seq[M]]; foreignKeyFieldName: static string)
sqlite: selectOneToMany[O: Model; M: Model](dbConn; oneEntry: O; relatedEntries: var seq[M])
sqlite: selectOneToMany[O: Model; M: Model](dbConn; oneEntry: O; relatedEntries: var seq[M]; foreignKeyFieldName: static string)
sqlite: selectOneToMany[O: Model; M: Model](dbConn; oneEntries: seq[O]; relatedEntries: var seq[M])
sqlite: selectOneToMany[O: Model; M: Model](dbConn; oneEntries: seq[O]; relatedEntries: var Table[int64, seq[M]]; foreignKeyFieldName: static string)
size:
pool: size(pool: Pool): Natural
StringOfCap:
types: StringOfCap
sum:
postgres: sum(dbConn; T: typedesc[Model]; col: string; dist = false; cond = "TRUE"; params: varargs[DbValue, dbValue]): float
sqlite: sum(dbConn; T: typedesc[Model]; col: string; dist = false; cond = "1"; params: varargs[DbValue, dbValue]): float
table:
model: table(T: typedesc[Model]): string
tableName:
pragmas: tableName(val: string)
to:
dbtypes: to(dbVal; T: typedesc[SomeInteger | enum]): T:type
dbtypes: to(dbVal; T: typedesc[bool]): T:type
dbtypes: to(dbVal; T: typedesc[DateTime]): T:type
dbtypes: to(dbVal; T: typedesc[Model]): T:type
dbtypes: to[T](dbVal; O: typedesc[Option[T]]): O:type
dbtypes: to[T1](dbVal; T2: typedesc[PaddedStringOfCap[T1]]): T2:type
dbtypes: to(dbVal; T: typedesc[SomeFloat]): T:type
dbtypes: to(dbVal; T: typedesc[string]): T:type
dbtypes: to[T1](dbVal; T2: typedesc[StringOfCap[T1]]): T2:type
dbtypes: to(dbVal; T: typedesc[SomeInteger | enum]): T:type
dbtypes: to(dbVal; T: typedesc[bool]): T:type
dbtypes: to(dbVal; T: typedesc[DateTime]): T:type
dbtypes: to(dbVal; T: typedesc[DbBlob]): T:type
dbtypes: to(dbVal; T: typedesc[Model]): T:type
dbtypes: to[T](dbVal; O: typedesc[Option[T]]): O:type
dbtypes: to[T1](dbVal; T2: typedesc[PaddedStringOfCap[T1]]): T2:type
dbtypes: to(dbVal; T: typedesc[SomeFloat]): T:type
dbtypes: to(dbVal; T: typedesc[string]): T:type
dbtypes: to[T1](dbVal; T2: typedesc[StringOfCap[T1]]): T2:type
toOptional:
utils: toOptional[T: ref object](val: Option[T]): Option[T]
utils: toOptional[T: ref object](val: T): Option[T]
toRow:
rowutils: toRow[T: Model](obj: T; force = false): Row
rowutils: toRow[T: Model](obj: T; force = false): Row
transaction:
postgres: transaction(dbConn; body: untyped): untyped
sqlite: transaction(dbConn; body: untyped): untyped
unique:
pragmas: unique()
uniqueGroup:
pragmas: uniqueGroup()
uniqueIndex:
pragmas: uniqueIndex(val: string)
update:
postgres: update[T: Model](dbConn; objs: var openArray[T])
postgres: update[T: Model](dbConn; obj: var T)
sqlite: update[T: Model](dbConn; objs: var openArray[T])
sqlite: update[T: Model](dbConn; obj: var T)
validateFkField:
model: validateFkField[S, T: Model](fkFieldName: static string; source: typedesc[S]; target: typedesc[T]): bool
validateJoinModelFkField:
model: validateJoinModelFkField[S, T: Model](fkFieldName: static string; joinModel: typedesc[S]; target: typedesc[T]): bool
withDb:
pool: withDb(pool: var Pool; body: untyped): untyped
postgres: withDb(body: untyped): untyped
sqlite: withDb(body: untyped): untyped