mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 07:43:26 +00:00
25
tests/stdlib/tdb.nim
Normal file
25
tests/stdlib/tdb.nim
Normal file
@@ -0,0 +1,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")
|
||||
1
tests/stdlib/tdb.nims
Normal file
1
tests/stdlib/tdb.nims
Normal file
@@ -0,0 +1 @@
|
||||
--styleCheck:off
|
||||
Reference in New Issue
Block a user