1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ast: SqlExpr

This commit is contained in:
Alexander Medvednikov
2020-06-16 12:14:22 +02:00
parent 2daf915371
commit e8f8defc3e
7 changed files with 72 additions and 17 deletions

View File

@@ -27,9 +27,11 @@ fn C.sqlite3_finalize()
fn C.sqlite3_column_count(voidptr) int
// Opens the connection with a database.
pub fn connect(path string) DB {
pub fn connect(path string) ?DB {
db := &C.sqlite3(0)
C.sqlite3_open(path.str, &db)
if C.sqlite3_open(path.str, &db) != 0 {
return error('sqlite db error')
}
return DB{
conn: db
}