pg: fix compilation

pull/5272/head
Alexander Medvednikov 2020-06-07 16:05:44 +02:00
parent 931cf86cc3
commit e029044b13
2 changed files with 3 additions and 2 deletions

View File

@ -12,7 +12,7 @@ fn test_orm() {
db := pg.connect(
dbname:'vpm'
user:'alex'
)
) or { panic(err) }
/*
//nr_modules := db.select count from modules
//nr_modules := db.select count from Modules where id == 1

View File

@ -128,7 +128,8 @@ pub fn (db DB) exec_one(query string) ?Row {
// free. This prevents warnings and doesn't seem to affect behavior.
pub fn (db DB) exec_param_many(query string, params []string) []Row {
unsafe {
mut param_vals := &byteptr( malloc( params.len * sizeof(byteptr) ) )
b := sizeof(byteptr)
mut param_vals := &byteptr(malloc(params.len * 8))
for i in 0..params.len {
param_vals[i] = params[i].str
}