chore: fix biome lints

This commit is contained in:
avallete committed 2025-09-02 11:18:58 +02:00
1 parent 87383143c9
commit 210a2b555b
6 files changed
+63 -61

No files matched your search

+1 -1
View File
@@ -1,8 +1,8 @@
import { z } from 'zod'
import { DEFAULT_SYSTEM_SCHEMAS } from './constants'
import { filterByList, filterByValue } from './helpers'
import { ident, literal } from './pg-format'
import { COLUMNS_SQL } from './sql/columns'
import { z } from 'zod'
const pgColumnZod = z.object({
id: z.string(),
@@ -1,10 +1,10 @@
import { literal, ident } from './pg-format'
import { z } from 'zod'
import { DEFAULT_SYSTEM_SCHEMAS } from './constants'
import { filterByList, coalesceRowsToArray } from './helpers'
import { FOREIGN_TABLES_SQL } from './sql/foreign-tables'
import { COLUMNS_SQL } from './sql/columns'
import { coalesceRowsToArray, filterByList } from './helpers'
import { ident, literal } from './pg-format'
import { pgColumnArrayZod } from './pg-meta-columns'
import { COLUMNS_SQL } from './sql/columns'
import { FOREIGN_TABLES_SQL } from './sql/foreign-tables'
export const pgForeignTableZod = z.object({
id: z.number(),
@@ -1,10 +1,10 @@
import { literal, ident } from './pg-format'
import { z } from 'zod'
import { DEFAULT_SYSTEM_SCHEMAS } from './constants'
import { filterByList, coalesceRowsToArray } from './helpers'
import { MATERIALIZED_VIEWS_SQL } from './sql/materialized-views'
import { COLUMNS_SQL } from './sql/columns'
import { coalesceRowsToArray, filterByList } from './helpers'
import { ident, literal } from './pg-format'
import { pgColumnArrayZod } from './pg-meta-columns'
import { COLUMNS_SQL } from './sql/columns'
import { MATERIALIZED_VIEWS_SQL } from './sql/materialized-views'
export const pgMaterializedViewZod = z.object({
id: z.number(),
@@ -86,7 +86,7 @@ export function retrieve(identifier: MaterializedViewIdentifier): {
sql: string
zod: typeof pgMaterializedViewOptionalZod
} {
let whereClause = getIdentifierWhereClause(identifier)
const whereClause = getIdentifierWhereClause(identifier)
const sql = `${generateEnrichedMaterializedViewsSql({ includeColumns: true })} where ${whereClause};`
return {
+6 -4
View File
@@ -1,10 +1,10 @@
import { z } from 'zod'
import { coalesceRowsToArray, filterByList, filterByValue } from './helpers'
import { TABLES_SQL } from './sql/tables'
import { COLUMNS_SQL } from './sql/columns'
import { DEFAULT_SYSTEM_SCHEMAS } from './constants'
import { coalesceRowsToArray, filterByList, filterByValue } from './helpers'
import { ident, literal } from './pg-format'
import { pgColumnArrayZod } from './pg-meta-columns'
import { COLUMNS_SQL } from './sql/columns'
import { TABLES_SQL } from './sql/tables'
const pgTablePrimaryKeyZod = z.object({
table_id: z.number(),
@@ -129,7 +129,9 @@ type TableCreateParams = {
comment?: string
}
function create({ name, schema = 'public', comment }: TableCreateParams): { sql: string } {
function create({ name, schema = 'public', comment }: TableCreateParams): {
sql: string
} {
const tableSql = `CREATE TABLE ${ident(schema)}.${ident(name)} ();`
const commentSql =
comment === undefined
+5 -5
View File
@@ -1,10 +1,10 @@
import { literal, ident } from './pg-format'
import { z } from 'zod'
import { DEFAULT_SYSTEM_SCHEMAS } from './constants'
import { filterByList, coalesceRowsToArray } from './helpers'
import { VIEWS_SQL } from './sql/views'
import { COLUMNS_SQL } from './sql/columns'
import { coalesceRowsToArray, filterByList } from './helpers'
import { ident, literal } from './pg-format'
import { pgColumnArrayZod } from './pg-meta-columns'
import { COLUMNS_SQL } from './sql/columns'
import { VIEWS_SQL } from './sql/views'
export const pgViewZod = z.object({
id: z.number(),
@@ -84,7 +84,7 @@ export function retrieve(identifier: ViewIdentifier): {
sql: string
zod: typeof pgViewOptionalZod
} {
let whereClause = getIdentifierWhereClause(identifier)
const whereClause = getIdentifierWhereClause(identifier)
const sql = `${generateEnrichedViewsSql({ includeColumns: true })} where ${whereClause};`
return {
+42 -42
View File
@@ -585,6 +585,26 @@ withTestDatabase('retrieve table by id', async ({ executeQuery }) => {
{
"bytes": Any<Number>,
"columns": [
{
"check": null,
"comment": null,
"data_type": "integer",
"default_value": "nextval('memes_id_seq'::regclass)",
"enums": [],
"format": "int4",
"id": "16510.1",
"identity_generation": null,
"is_generated": false,
"is_identity": false,
"is_nullable": false,
"is_unique": false,
"is_updatable": true,
"name": "id",
"ordinal_position": 1,
"schema": "public",
"table": "memes",
"table_id": 16510,
},
{
"check": null,
"comment": null,
@@ -665,26 +685,6 @@ withTestDatabase('retrieve table by id', async ({ executeQuery }) => {
"table": "memes",
"table_id": 16510,
},
{
"check": null,
"comment": null,
"data_type": "integer",
"default_value": "nextval('memes_id_seq'::regclass)",
"enums": [],
"format": "int4",
"id": "16510.1",
"identity_generation": null,
"is_generated": false,
"is_identity": false,
"is_nullable": false,
"is_unique": false,
"is_updatable": true,
"name": "id",
"ordinal_position": 1,
"schema": "public",
"table": "memes",
"table_id": 16510,
},
{
"check": null,
"comment": null,
@@ -761,6 +761,26 @@ withTestDatabase('retrieve table by name and schema', async ({ executeQuery }) =
{
"bytes": Any<Number>,
"columns": [
{
"check": null,
"comment": null,
"data_type": "integer",
"default_value": "nextval('memes_id_seq'::regclass)",
"enums": [],
"format": "int4",
"id": "16510.1",
"identity_generation": null,
"is_generated": false,
"is_identity": false,
"is_nullable": false,
"is_unique": false,
"is_updatable": true,
"name": "id",
"ordinal_position": 1,
"schema": "public",
"table": "memes",
"table_id": 16510,
},
{
"check": null,
"comment": null,
@@ -841,26 +861,6 @@ withTestDatabase('retrieve table by name and schema', async ({ executeQuery }) =
"table": "memes",
"table_id": 16510,
},
{
"check": null,
"comment": null,
"data_type": "integer",
"default_value": "nextval('memes_id_seq'::regclass)",
"enums": [],
"format": "int4",
"id": "16510.1",
"identity_generation": null,
"is_generated": false,
"is_identity": false,
"is_nullable": false,
"is_unique": false,
"is_updatable": true,
"name": "id",
"ordinal_position": 1,
"schema": "public",
"table": "memes",
"table_id": 16510,
},
{
"check": null,
"comment": null,
@@ -921,7 +921,7 @@ withTestDatabase('retrieve table by name and schema', async ({ executeQuery }) =
)
})
withTestDatabase('retrieve error if missing identifiers', async ({}) => {
withTestDatabase('retrieve error if missing identifiers', async () => {
await expect(async () => {
//@ts-expect-error use with missing params
await pgMeta.tables.retrieve({ name: 'memes' })
@@ -985,7 +985,7 @@ withTestDatabase('remove throws error for non-existent table', async ({ executeQ
)
})
withTestDatabase('remove throws error with missing identifiers', async ({}) => {
withTestDatabase('remove throws error with missing identifiers', async () => {
await expect(async () => {
//@ts-expect-error use with missing params
await pgMeta.tables.remove({ name: 'some_table' })