File tree Expand file tree Collapse file tree
apps/dev-playground/server/lakebase-examples Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ class Order
4444let sequelize : Sequelize ;
4545
4646export async function setup ( ) {
47+ // @ts -expect-error password property supports a function for Lakehouse OAuth tokens
4748 sequelize = new Sequelize ( {
4849 dialect : "postgres" ,
4950 ...getLakebaseOrmConfig ( ) ,
Original file line number Diff line number Diff line change 1- import { getLakebaseOrmConfig } from "@databricks/appkit" ;
1+ import { createLakebasePool , getLakebaseOrmConfig } from "@databricks/appkit" ;
22import type { IAppRouter } from "shared" ;
33import {
44 Column ,
@@ -44,6 +44,12 @@ class Task {
4444let dataSource : DataSource ;
4545
4646export async function setup ( ) {
47+ // Create schema if not exists (TypeORM's synchronize doesn't create schemas)
48+ // See https://github.com/typeorm/typeorm/issues/3192
49+ const pool = createLakebasePool ( ) ;
50+ await pool . query ( "CREATE SCHEMA IF NOT EXISTS typeorm_example" ) ;
51+ await pool . end ( ) ;
52+
4753 dataSource = new DataSource ( {
4854 type : "postgres" ,
4955 ...getLakebaseOrmConfig ( ) ,
You can’t perform that action at this time.
0 commit comments