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

pg: minor fixes

This commit is contained in:
Alexander Medvednikov 2019-11-23 19:45:35 +03:00
parent e724792a67
commit 0fb0c43c0a
4 changed files with 28 additions and 25 deletions

View File

@ -41,5 +41,6 @@
+ fast.vlang.io
+ bare metal support
+ inline assembly
+ x64 machine code generation (ELF)

View File

@ -1625,7 +1625,9 @@ fn (p mut Parser) var_expr(v Var) string {
p.next()
return p.select_query(fn_ph)
}
if typ == 'pg__DB' && !p.fileis('pg.v') && p.peek() == .name {
if typ == 'pg__DB' && !p.fileis('pg.v') && p.peek() == .name &&
!p.tokens[p.token_idx].lit.contains('exec')
{
p.next()
p.insert_query(fn_ph)
return 'void'

View File

@ -5,19 +5,19 @@ module pg
#flag darwin -I/opt/local/include/postgresql11
#include <libpq-fe.h>
struct DB {
pub struct DB {
mut:
conn &C.PGconn
}
struct Row {
pub struct Row {
pub mut:
vals []string
}
struct C.PGResult { }
struct Config {
pub struct Config {
pub:
host string
user string