orm: handle bool literals for older sqlite versions
parent
16dd889922
commit
db28796b5f
|
@ -206,6 +206,12 @@ fn (mut g Gen) expr_to_sql(expr ast.Expr) {
|
||||||
g.inc_sql_i()
|
g.inc_sql_i()
|
||||||
g.sql_bind_int(it.val)
|
g.sql_bind_int(it.val)
|
||||||
}
|
}
|
||||||
|
ast.BoolLiteral {
|
||||||
|
// true/false literals were added to Sqlite 3.23 (2018-04-02)
|
||||||
|
// but lots of apps/distros use older sqlite (e.g. Ubuntu 18.04 LTS )
|
||||||
|
g.inc_sql_i()
|
||||||
|
g.sql_bind_int(if it.val { '1' } else { '0' })
|
||||||
|
}
|
||||||
ast.Ident {
|
ast.Ident {
|
||||||
// `name == user_name` => `name == ?1`
|
// `name == user_name` => `name == ?1`
|
||||||
// for left sides just add a string, for right sides, generate the bindings
|
// for left sides just add a string, for right sides, generate the bindings
|
||||||
|
|
|
@ -100,9 +100,9 @@ fn (mut p Parser) vweb() ast.ComptimeCall {
|
||||||
}
|
}
|
||||||
// println('path is now "$path"')
|
// println('path is now "$path"')
|
||||||
}
|
}
|
||||||
// if p.pref.is_verbose {
|
if p.pref.is_verbose {
|
||||||
println('>>> compiling vweb HTML template "$path"')
|
println('>>> compiling vweb HTML template "$path"')
|
||||||
// }
|
}
|
||||||
v_code := tmpl.compile_file(path, p.cur_fn_name)
|
v_code := tmpl.compile_file(path, p.cur_fn_name)
|
||||||
mut scope := &ast.Scope{
|
mut scope := &ast.Scope{
|
||||||
start_pos: 0
|
start_pos: 0
|
||||||
|
|
Loading…
Reference in New Issue