-
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdebug.js
More file actions
31 lines (21 loc) · 1.74 KB
/
debug.js
File metadata and controls
31 lines (21 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* This is by no means a real unit test or anything like
* that. It's just to see that it's working in the console.
*/
const { highlight } = require('../lib');
console.log(highlight("SELECT COUNT(id), COUNT(id), `id`, `username` FROM `users` WHERE `email` = 'test@example.com' AND `something` = 'oke' AND 1=1"));
console.log(highlight('SELECT "users".* FROM "users"'));
console.log(highlight('select "users".* from "users" where ("username" = \'test\' or "email" = \'test\') and "is_admin" = true and "is_banned" = false limit 1'));
console.log(highlight("SELECT COUNT(id), COUNT(id), `id`, `username` FROM `users` WHERE `email` = 'test@example.com' AND `something` = 'oke-doke' AND true = true"));
console.log(highlight('SELECT COUNT(id), `id`, `username` FROM `users` WHERE `email` = \'test@example.com\' AND (username in ( SELECT "name" from aTable)', { html: false }));
console.log(highlight('SELECT id FROM users'));
console.log(highlight('WITH t1 AS (SELECT data_point FROM tablename) SELECT data_point FROM t1;'));
console.log(highlight('SELECT f1, f20b, f3a, -1, 1, "1", 1.00 FROM t1;'));
console.log(highlight("SELECT id FROM listings WHERE status = 'not available'"));
console.log(highlight('SELECT id FROM listings WHERE status = "not available"'));
console.log(highlight('SELECT \'{"json_index":"json_value"}\' AS test;'));
console.log(highlight('SELECT "This is a \\"text\\" test" AS text;'));
console.log(highlight('DROP PROCEDURE IF EXISTS `some-database`.`some-table`;'));
console.log(highlight('SELECT * FROM a;SELECT * FROM b;'));
console.log(highlight('SELECT foo /* comment, not "keyword" WHERE GROUP */ FROM bar; -- comment\nSELECT * FROM baz;'));
console.log(highlight("select * from a where b = 'array<map<string,string>>';", { html: true }));