diff --git a/vlib/v/gen/sql.v b/vlib/v/gen/sql.v index 36a6c683e1..f620b2541c 100644 --- a/vlib/v/gen/sql.v +++ b/vlib/v/gen/sql.v @@ -36,8 +36,10 @@ fn (mut g Gen) sql_expr(node ast.SqlExpr) { g.sql_stmt_name = g.new_tmp_var() db_name := g.new_tmp_var() g.writeln('\n\t// sql') - g.write('${dbtype}__DB $db_name = *(${dbtype}__DB*)${node.db_var_name}.data;') - g.write('sqlite3_stmt* $g.sql_stmt_name = ${dbtype}__DB_init_stmt(*(${dbtype}__DB*)${node.db_var_name}.data, tos_lit("$q') + // g.write('${dbtype}__DB $db_name = *(${dbtype}__DB*)${node.db_var_name}.data;') + g.write('${dbtype}__DB $db_name = ${node.db_var_name};') + // g.write('sqlite3_stmt* $g.sql_stmt_name = ${dbtype}__DB_init_stmt(*(${dbtype}__DB*)${node.db_var_name}.data, tos_lit("$q') + g.write('sqlite3_stmt* $g.sql_stmt_name = ${dbtype}__DB_init_stmt($db_name, tos_lit("$q') if node.has_where && node.where_expr is ast.InfixExpr { g.expr_to_sql(node.where_expr) }