2023-05-04 10:13:05 +08:00
|
|
|
import PostgresSQL from "../../../src/parser/pgsql";
|
2022-12-16 03:26:34 +08:00
|
|
|
|
|
|
|
describe('Generic SQL Syntax Tests', () => {
|
|
|
|
const parser = new PostgresSQL();
|
|
|
|
|
|
|
|
test('Select Statement', () => {
|
|
|
|
const sql = 'select id,name from user1;';
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|