For inserts targeting omnisharded columns, we should intercept and rewrite calls to now() (and other timestamp-related functions) and replace them with a value we generate. This makes sure the value is the same on all shards.
Example
INSERT INTO omni (name, created_at) VALUES ('test', now());
INSERT INTO omni (name, created_at) VALUES ('test', '2026-09-10T10:00:01.342Z');
Make sure to handle this for TIMESTAMPTZ (UTC) and TIMESTAMP; the latter needs to fetch the database timezone and use that.
Additionally, for queries that don't specify now() and rely on a database default, we should inject our timestamp, just like we do for primary keys (auto_id).
For inserts targeting omnisharded columns, we should intercept and rewrite calls to
now()(and other timestamp-related functions) and replace them with a value we generate. This makes sure the value is the same on all shards.Example
Make sure to handle this for
TIMESTAMPTZ(UTC) andTIMESTAMP; the latter needs to fetch the database timezone and use that.Additionally, for queries that don't specify
now()and rely on a database default, we should inject our timestamp, just like we do for primary keys (auto_id).