1
0
mirror of https://github.com/theoludwig/kysely-typegen.git synced 2026-05-22 16:23:25 +02:00

test: update snapshot to exclude kysely getTables output

This commit is contained in:
2026-05-22 10:27:07 +02:00
parent 3d2563a6ad
commit 786087ee06
2 changed files with 7 additions and 502 deletions
+2 -501
View File
@@ -103,506 +103,7 @@ exports[`typegen > generate types matching snapshot 1`] = `
" Users: Users",
"}"
],
"enums": [
{
"name": "Currency",
"values": [
"EUR",
"GBP",
"USD"
]
},
{
"name": "OrderStatus",
"values": [
"cancelled",
"paid",
"pending",
"shipped"
]
},
{
"name": "UserRole",
"values": [
"admin",
"guest",
"member"
]
}
],
"tables": [
{
"columns": [
{
"dataType": "uuid",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": true,
"isAutoIncrementing": false,
"isNullable": false,
"name": "id"
},
{
"dataType": "bool",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colBool"
},
{
"dataType": "bool",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": true,
"name": "colBoolNullable"
},
{
"dataType": "bool",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": true,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colBoolDefault"
},
{
"dataType": "int2",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colInt2"
},
{
"dataType": "int4",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colInt4"
},
{
"dataType": "int8",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colInt8"
},
{
"dataType": "float4",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colFloat4"
},
{
"dataType": "float8",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colFloat8"
},
{
"dataType": "numeric",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colNumeric"
},
{
"dataType": "money",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colMoney"
},
{
"dataType": "text",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colText"
},
{
"dataType": "varchar",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colVarchar"
},
{
"dataType": "bpchar",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colBpchar"
},
{
"dataType": "bytea",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colBytea"
},
{
"dataType": "date",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colDate"
},
{
"dataType": "time",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colTime"
},
{
"dataType": "timetz",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colTimetz"
},
{
"dataType": "timestamp",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colTimestamp"
},
{
"dataType": "timestamptz",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colTimestamptz"
},
{
"dataType": "json",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colJson"
},
{
"dataType": "jsonb",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colJsonb"
},
{
"dataType": "uuid",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colUuid"
},
{
"dataType": "inet",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colInet"
},
{
"dataType": "cidr",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colCidr"
},
{
"dataType": "macaddr",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colMacaddr"
},
{
"dataType": "bit",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colBit"
},
{
"dataType": "varbit",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colVarbit"
},
{
"dataType": "xml",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colXml"
},
{
"dataType": "tsvector",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colTsvector"
},
{
"dataType": "tsquery",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colTsquery"
},
{
"dataType": "point",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colPoint"
},
{
"dataType": "line",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colLine"
},
{
"dataType": "lseg",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colLseg"
},
{
"dataType": "box",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colBox"
},
{
"dataType": "path",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colPath"
},
{
"dataType": "polygon",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colPolygon"
},
{
"dataType": "oid",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colOid"
},
{
"dataType": "text",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": true,
"name": "colTextNullable"
},
{
"dataType": "jsonb",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": true,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colJsonbDefault"
},
{
"dataType": "timestamp",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": true,
"isAutoIncrementing": false,
"isNullable": false,
"name": "colTimestampDefault"
},
{
"dataType": "timestamptz",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": true,
"isAutoIncrementing": false,
"isNullable": false,
"name": "createdAt"
},
{
"dataType": "timestamptz",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": true,
"name": "updatedAt"
}
],
"isForeign": false,
"isView": false,
"name": "AllTypes",
"schema": "public"
},
{
"columns": [
{
"dataType": "int8",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": true,
"isAutoIncrementing": true,
"isNullable": false,
"name": "id"
},
{
"dataType": "uuid",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "userId"
},
{
"dataType": "OrderStatus",
"dataTypeSchema": "public",
"hasDefaultValue": true,
"isAutoIncrementing": false,
"isNullable": false,
"name": "status"
},
{
"dataType": "Currency",
"dataTypeSchema": "public",
"hasDefaultValue": true,
"isAutoIncrementing": false,
"isNullable": false,
"name": "currency"
},
{
"dataType": "int4",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "amountCents"
},
{
"dataType": "text",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": true,
"name": "note"
},
{
"dataType": "timestamptz",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": true,
"isAutoIncrementing": false,
"isNullable": false,
"name": "createdAt"
}
],
"isForeign": false,
"isView": false,
"name": "Orders",
"schema": "public"
},
{
"columns": [
{
"dataType": "uuid",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": true,
"isAutoIncrementing": false,
"isNullable": false,
"name": "id"
},
{
"dataType": "varchar",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": false,
"name": "username"
},
{
"dataType": "text",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": false,
"isAutoIncrementing": false,
"isNullable": true,
"name": "email"
},
{
"dataType": "UserRole",
"dataTypeSchema": "public",
"hasDefaultValue": true,
"isAutoIncrementing": false,
"isNullable": false,
"name": "role"
},
{
"dataType": "bool",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": true,
"isAutoIncrementing": false,
"isNullable": false,
"name": "isActive"
},
{
"dataType": "timestamptz",
"dataTypeSchema": "pg_catalog",
"hasDefaultValue": true,
"isAutoIncrementing": false,
"isNullable": false,
"name": "createdAt"
}
],
"isForeign": false,
"isView": false,
"name": "Users",
"schema": "public"
}
]
"tablesCount": 3,
"enumsCount": 3
}
`;
+5 -1
View File
@@ -237,6 +237,10 @@ describe("typegen", () => {
const result = await databaseTypegen.typegen()
// Assert - Then
testContext.assert.snapshot(result)
testContext.assert.snapshot({
lines: result.lines,
tablesCount: result.tables.length,
enumsCount: result.enums.length,
})
})
})