feat: Implemented launching and downloading of roms

This is just an initial implementation lots of kings to iron out
This commit is contained in:
Simeon Radivoev 2026-02-19 16:10:29 +02:00
parent ef08fa6114
commit f15bf9a1e0
Signed by: simeonradivoev
GPG key ID: 7611A451D2A5D37A
117 changed files with 37776 additions and 1073 deletions

View file

@ -0,0 +1,43 @@
import { relations, sql } from "drizzle-orm";
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
export const emulators = sqliteTable('emulators', {
name: text().primaryKey().unique(),
systempath: text({ mode: 'json' }).notNull().$type<string[]>().default(sql`(json_array())`),
staticpath: text({ mode: 'json' }).notNull().$type<string[]>().default(sql`(json_array())`),
corepath: text({ mode: 'json' }).notNull().$type<string[]>().default(sql`(json_array())`),
androidpackage: text({ mode: 'json' }).notNull().$type<string[]>().default(sql`(json_array())`),
winregistrypath: text({ mode: 'json' }).notNull().$type<string[]>().default(sql`(json_array())`),
});
export const systems = sqliteTable('systems', {
name: text().primaryKey().unique(),
fullname: text(),
path: text(),
extension: text({ mode: 'json' }).notNull().$type<string[]>().default(sql`(json_array())`)
});
export const systemsRelations = relations(systems, ({ many }) =>
({
commands: many(commands)
}));
export const systemMappings = sqliteTable('systemMappings', {
source: text(),
sourceSlug: text(),
sourceId: integer(),
system: text().notNull().references(() => systems.name)
});
export const commands = sqliteTable('commands', {
system: text().references(() => systems.name, { onDelete: 'cascade', onUpdate: 'cascade' }),
label: text(),
command: text().notNull()
});
export const commandsRelations = relations(commands, ({ one }) => ({
author: one(systems, {
fields: [commands.system],
references: [systems.name],
}),
}));