Files
Kazier/mobile/services/db/id.ts
T
2026-09-10 06:39:25 +02:00

9 lines
256 B
TypeScript

import { getSession } from './session';
export async function newResourceId(): Promise<string> {
const db = await getSession();
const row = await db.getFirstAsync<{ id: string }>(
'SELECT lower(hex(randomblob(16))) AS id',
);
return row!.id;
}