You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE OR REPLACEFUNCTIONnext_id(IN seq regclass, OUT result bigint) AS $$
DECLARE
-- 6/4/2013 00:00:00 GMT
our_epoch bigint :=1370304000000;
seq_id bigint;
now_millis bigint;
shard_id int :=1;
BEGINSELECT nextval(seq) % 1024 INTO seq_id;
SELECT FLOOR(EXTRACT(EPOCH FROM clock_timestamp()) *1000) INTO now_millis;
result := (now_millis - our_epoch) <<23;
result := result | (shard_id <<10);
result := result | (seq_id);
END;
$$ LANGUAGE PLPGSQL;
Version
1.27.0
What happened?
Sqlc panics when generating from migration containing PLPGSQL function
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
No response
What operating system are you using?
Linux
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: