Files
supabase/packages/pg-meta/src/query/Query.ts
Andrew Valleteau eb7efdef7f chore(studio): move Query to pgMeta add tests (#34232)
* chore(studio): move Query to pgMeta add tests

- Move the Query builder from studio to pgMeta
- Add e2e tests over the generated sql to ensure syntax and runtime
  result over pg database
- fix bug with orde by for table with undefined column

* chore: fix query import path

* chore: set ES target for lint

* chore: add github action for pg-meta test package

* chore: add tsconfig to sparse checkout
2025-03-20 19:04:58 +00:00

19 lines
419 B
TypeScript

import { IQueryAction, QueryAction } from './QueryAction'
interface IQuery {
from: (table: string, schema?: string) => IQueryAction
}
export class Query implements IQuery {
/**
* @param name the table name.
* @param schema the table schema, by default set to 'public'.
*/
from(name: string, schema?: string) {
return new QueryAction({
name,
schema: schema ?? 'public',
})
}
}