We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18f88e9 commit e332754Copy full SHA for e332754
tests/union.test.js
@@ -0,0 +1,13 @@
1
+const wasm = require('../node_modules/sqlparser-rs-wasm');
2
+const Converter = require('../src/converter');
3
+
4
+test('union all for users where null', () => {
5
+ const sql = "(select * from `users` where `last_name` is null) union all (select * from `users` where `first_name` is null) order by id";
6
+ const ast = wasm.parse_sql('--mysql', sql);
7
+ const conv = new Converter(ast, null);
8
+ const out = conv.run(true);
9
10
+ const expected = `DB::table('users')\n->whereNull('last_name')\n->unionAll(\n DB::table('users')\n ->whereNull('first_name')\n)\n->orderBy('id')\n->get();`;
11
12
+ expect(out.replace(/\s+$/g, '')).toBe(expected);
13
+});
0 commit comments