tdb.nim 697 B

1234567891011121314151617181920212223242526
  1. discard """
  2. action: "compile"
  3. """
  4. import db_mysql, db_odbc, db_postgres
  5. import os
  6. from stdtest/specialpaths import buildDir
  7. block:
  8. block:
  9. const dbName = buildDir / "db.sqlite3"
  10. var db = db_mysql.open(dbName, "", "", "")
  11. discard tryInsertId(db, sql"INSERT INTO myTestTbl (name,i,f) VALUES (?,?,?)", "t")
  12. block:
  13. const dbName = buildDir / "db.odbc"
  14. var db = db_odbc.open(dbName, "", "", "")
  15. discard tryInsertId(db, sql"INSERT INTO myTestTbl (name,i,f) VALUES (?,?,?)", "t")
  16. block:
  17. const dbName = buildDir / "db.postgres"
  18. var db = db_postgres.open(dbName, "", "", "")
  19. discard tryInsertId(db, sql"INSERT INTO myTestTbl (name,i,f) VALUES (?,?,?)", "t")