|
|
|
@ -72,19 +72,19 @@ describe('helpers/sql-utils', function () {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('.getDefaultSQL', function () {
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('table', 'user', false)).toBe('SELECT * FROM table');
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('table', 'user', false)).toBe('SELECT * FROM public.table');
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('table', 'user', true)).toBe('SELECT * FROM user.table');
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('table', undefined, true)).toBe('SELECT * FROM table');
|
|
|
|
|
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('1table', 'user', false)).toBe('SELECT * FROM "1table"');
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('1table', 'user', false)).toBe('SELECT * FROM public."1table"');
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('1table', 'user', true)).toBe('SELECT * FROM user."1table"');
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('1table', undefined, true)).toBe('SELECT * FROM "1table"');
|
|
|
|
|
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('table', 'user-me', false)).toBe('SELECT * FROM table');
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('table', 'user-me', false)).toBe('SELECT * FROM public.table');
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('table', 'user-me', true)).toBe('SELECT * FROM "user-me".table');
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('table', undefined, true)).toBe('SELECT * FROM table');
|
|
|
|
|
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('tabl-e', '1stuser', false)).toBe('SELECT * FROM "tabl-e"');
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('tabl-e', '1stuser', false)).toBe('SELECT * FROM public."tabl-e"');
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('tabl-e', '1stuser', true)).toBe('SELECT * FROM "1stuser"."tabl-e"');
|
|
|
|
|
expect(SQLUtils.getDefaultSQL('tabl-e', undefined, true)).toBe('SELECT * FROM "tabl-e"');
|
|
|
|
|
});
|
|
|
|
|