debug: add raw value snippet to debug-sequences for regex diagnostics
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,17 +22,18 @@ export async function GET() {
|
|||||||
Array<{ company: string; year: number; type: string; lastSeq: number }>
|
Array<{ company: string; year: number; type: string; lastSeq: number }>
|
||||||
>`SELECT company, year, type, "lastSeq" FROM "RegistrySequence" ORDER BY company, year, type`;
|
>`SELECT company, year, type, "lastSeq" FROM "RegistrySequence" ORDER BY company, year, type`;
|
||||||
|
|
||||||
// Sample: show actual number values from entries (for debugging regex issues)
|
// Sample: show raw value snippet + extracted number (for debugging regex issues)
|
||||||
const samples = await prisma.$queryRawUnsafe<
|
const samples = await prisma.$queryRawUnsafe<
|
||||||
Array<{ key: string; num: string }>
|
Array<{ key: string; num: string | null; snippet: string }>
|
||||||
>(`
|
>(`
|
||||||
SELECT key,
|
SELECT key,
|
||||||
SUBSTRING(value::text FROM '"number":"([^"]+)"') AS num
|
SUBSTRING(value::text FROM '"number":"([^"]+)"') AS num,
|
||||||
|
SUBSTRING(value::text FROM 1 FOR 200) AS snippet
|
||||||
FROM "KeyValueStore"
|
FROM "KeyValueStore"
|
||||||
WHERE namespace = 'registratura'
|
WHERE namespace = 'registratura'
|
||||||
AND key LIKE 'entry:%'
|
AND key LIKE 'entry:%'
|
||||||
ORDER BY key
|
ORDER BY key
|
||||||
LIMIT 20
|
LIMIT 5
|
||||||
`);
|
`);
|
||||||
|
|
||||||
// Get actual max sequences from entries — current format: B-2026-00001
|
// Get actual max sequences from entries — current format: B-2026-00001
|
||||||
|
|||||||
Reference in New Issue
Block a user