initial commit

This commit is contained in:
Ken Yasue
2025-06-01 22:21:33 +02:00
commit 5149012dcf
30 changed files with 6346 additions and 0 deletions

17
schema/index.ts Normal file
View File

@ -0,0 +1,17 @@
"use node"
import { dataSource } from "./data-source";
import { UserEntity } from "./entity/UserEntity";
let dbInstance = dataSource;
// you can add a try catch
export const dbSource = async () => {
if(!dataSource.isInitialized) {
dbInstance = await dataSource.initialize();
}
return {
userRepository: dbInstance.getRepository(UserEntity),
}
}