first commit

This commit is contained in:
Hydra 2024-04-14 04:20:27 +01:00
commit 992ec5ab49
No known key found for this signature in database
145 changed files with 37479 additions and 0 deletions

33
src/main/data-source.ts Normal file
View file

@ -0,0 +1,33 @@
import { DataSource } from "typeorm";
import {
Game,
GameShopCache,
ImageCache,
Repack,
RepackerFriendlyName,
UserPreferences,
MigrationScript,
} from "@main/entity";
import type { SqliteConnectionOptions } from "typeorm/driver/sqlite/SqliteConnectionOptions";
import { databasePath } from "./constants";
export const createDataSource = (options: Partial<SqliteConnectionOptions>) =>
new DataSource({
type: "sqlite",
database: databasePath,
entities: [
Game,
ImageCache,
Repack,
RepackerFriendlyName,
UserPreferences,
GameShopCache,
MigrationScript,
],
...options,
});
export const dataSource = createDataSource({
synchronize: true,
});