2023-10-13 11:16:36 +08:00
|
|
|
import PostgresSQL from '../../../src/parser/pgsql';
|
2022-12-16 03:26:34 +08:00
|
|
|
|
2023-05-30 14:44:03 +08:00
|
|
|
describe('PostgresSQL SQL Syntax Tests', () => {
|
2022-12-16 03:26:34 +08:00
|
|
|
const parser = new PostgresSQL();
|
|
|
|
|
|
|
|
test('Select Statement', () => {
|
2023-05-30 14:44:03 +08:00
|
|
|
const sql = 'select id, t_name from user1;';
|
2022-12-16 03:26:34 +08:00
|
|
|
const result = parser.validate(sql);
|
|
|
|
|
|
|
|
expect(result.length).toBe(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Select 1+1', () => {
|
|
|
|
const sql = 'SELECT 1+1;';
|
|
|
|
const result = parser.validate(sql);
|
|
|
|
expect(result.length).toBe(0);
|
|
|
|
});
|
2023-05-30 14:44:03 +08:00
|
|
|
|
|
|
|
test('Select 1+1', () => {
|
|
|
|
const sql = 'SELECT 1+1;';
|
|
|
|
const result = parser.validate(sql);
|
|
|
|
expect(result.length).toBe(0);
|
|
|
|
});
|
2022-12-16 03:26:34 +08:00
|
|
|
});
|