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

This commit is contained in:
2026-05-15 21:49:08 +03:00
parent 2e945c1dcb
commit 4e54075078
63 changed files with 9764 additions and 0 deletions
@@ -0,0 +1,38 @@
## Ormin -- ORM for Nim.
## (c) 2017 Andreas Rumpf
## MIT License.
import strutils, os, parseopt
import ../ormin/importer_core
proc writeHelp() =
echo """
ormin <schema.sql> --out:<file.nim> --db:postgre|sqlite|mysql
"""
proc writeVersion() = echo "v1.0"
var p = initOptParser()
var infile = ""
var outfile = ""
var target: ImportTarget
for kind, key, val in p.getopt():
case kind
of cmdArgument:
infile = key
of cmdLongOption, cmdShortOption:
case key
of "help", "h": writeHelp()
of "version", "v": writeVersion()
of "out", "o": outfile = val
of "db": target = parseEnum[ImportTarget](val)
else: discard
of cmdEnd: assert(false) # cannot happen
if infile == "":
# no filename has been given, so we show the help:
writeHelp()
else:
if outfile == "":
outfile = changeFileExt(infile, "nim")
writeFile(outfile, generateModelCode(readFile(infile), absolutePath(infile), target))