summary refs log tree commit diff stats
path: root/tests/stdlib/tdb.nim
blob: dbb0283bf3f915959c09bb9523e0147b38cadebf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
discard """
  action: "compile"
"""


import db_mysql, db_odbc, db_postgres
import os
from stdtest/specialpaths import buildDir


block:
  block:
    const dbName = buildDir / "db.sqlite3"
    var db = db_mysql.open(dbName, "", "", "")
    discard tryInsertId(db, sql"INSERT INTO myTestTbl (name,i,f) VALUES (?,?,?)", "t")

  block:
    const dbName = buildDir / "db.odbc"
    var db = db_odbc.open(dbName, "", "", "")
    discard tryInsertId(db, sql"INSERT INTO myTestTbl (name,i,f) VALUES (?,?,?)", "t")

  block:
    const dbName = buildDir / "db.postgres"
    var db = db_postgres.open(dbName, "", "", "")
    discard tryInsertId(db, sql"INSERT INTO myTestTbl (name,i,f) VALUES (?,?,?)", "t")