Skip to content

v3.10.14

Choose a tag to compare

@andrevanzuydam andrevanzuydam released this 28 Mar 20:55

What's New

  • get_next_id() — 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.get_next_id(table, pk_column: "id", generator_name: nil)