Skip to content

v3.10.14

Choose a tag to compare

@andrevanzuydam andrevanzuydam released this 28 Mar 20:55

What's New

  • getNextId() — Pre-generate the next available primary key ID with engine-aware strategies:
    • Firebird: auto-creates generator if missing, increments via GEN_ID
    • PostgreSQL: tries nextval() on standard sequence, falls back to MAX+1
    • SQLite/MySQL/MSSQL: uses MAX(pk) + 1
    • Returns 1 if table is empty or doesn't exist

API

db.getNextId(table: string, pkColumn = "id", generatorName?: string): number