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.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 { | ||||
| 			// `name == user_name` => `name == ?1`
 | ||||
| 			// 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"')
 | ||||
| 	} | ||||
| 	// if p.pref.is_verbose {
 | ||||
| 	println('>>> compiling vweb HTML template "$path"') | ||||
| 	// }
 | ||||
| 	if p.pref.is_verbose { | ||||
| 		println('>>> compiling vweb HTML template "$path"') | ||||
| 	} | ||||
| 	v_code := tmpl.compile_file(path, p.cur_fn_name) | ||||
| 	mut scope := &ast.Scope{ | ||||
| 		start_pos: 0 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue