Files
scriptshare-cursor/src/lib/db/browser.ts

34 lines
1.0 KiB
TypeScript

// Browser-compatible database interface
// This provides mock implementations for browser builds
export const db = {
query: {
users: {
findFirst: () => Promise.resolve(null),
findMany: () => Promise.resolve([]),
},
scripts: {
findFirst: () => Promise.resolve(null),
findMany: () => Promise.resolve([]),
},
},
select: () => ({ from: () => ({ where: () => Promise.resolve([]) }) }),
insert: () => ({ values: () => Promise.resolve() }),
update: () => ({ set: () => ({ where: () => Promise.resolve() }) }),
delete: () => ({ where: () => Promise.resolve() }),
};
// Export schema as empty objects for browser compatibility
export const users = {};
export const scripts = {};
export const ratings = {};
export const scriptVersions = {};
export const scriptAnalytics = {};
export const scriptCollections = {};
export const collectionScripts = {};
// Export empty relations
export const usersRelations = {};
export const scriptsRelations = {};
export const ratingsRelations = {};