@secam/pgsql-ast-parser
Version:
Fork of pgsql-ast-parser Simple Postgres SQL parser/modifier for pg-mem
30 lines (25 loc) • 599 B
text/typescript
import 'mocha';
import 'chai';
import { checkStatement } from './spec-utils';
describe('Alter types', () => {
checkStatement([`ALTER TYPE myType ADD VALUE 'c'`], {
type: 'alter enum',
name: { name: 'mytype' },
change: {
type: 'add value',
add: {
value: 'c'
}
}
});
checkStatement([`ALTER TYPE weight RENAME TO mass`], {
type: 'alter enum',
name: { name: 'weight' },
change: {
type: 'rename',
to: {
name: 'mass'
}
}
});
});