Skip to content

Commit

Permalink
Add more Postgres ast
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaireNeveu committed Mar 20, 2024
1 parent c3e3722 commit 910cafc
Show file tree
Hide file tree
Showing 4 changed files with 541 additions and 65 deletions.
5 changes: 5 additions & 0 deletions packages/sij-dialect-postgresql/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 120,
"arrowParens": "avoid",
"singleQuote": true
}
20 changes: 12 additions & 8 deletions packages/sij-dialect-postgresql/src/ast/index.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
import { Expr, Ident } from "sij-core/ast";
import { Tagged, UnTag, tag } from "sij-core/util";
import { Extend } from "sij-core/builder";
import { Expr, Ident } from 'sij-core/ast';
import { Tagged, UnTag, tag } from 'sij-core/util';
import { Extend } from 'sij-core/builder';
import { PgAlterDomainAction } from './schema-manipulation';

interface Window
extends Tagged<
"Window",
'Window',
{
name: Ident;
partitionBy: Array<Expr<PostgreSqlExtension>>;
partitionBy: Array<Expr<PgExtension>>;
}
> {}
const Window = (args: UnTag<Window>): Window => tag("Window", args);
const Window = (args: UnTag<Window>): Window => tag('Window', args);

type PostgreSqlExtension = Extend<{
type PgExtension = Extend<{
Select: null | {
window: Window | null;
};
Delete: {
using: Array<Ident>;
};
DomainAction: PgAlterDomainAction;
AddDomainConstraint: boolean;
DropDomainConstraint: boolean;
}>;

export { PostgreSqlExtension };
export { PgExtension };
Loading

0 comments on commit 910cafc

Please sign in to comment.