Replies: 1 comment 2 replies
-
Currently, there isn't a way to do this. Most database engines do not allow you to use placeholder values in table names. Can I ask what database engine you're using? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a bunch of sharded tables with name of the format:
table_001
,table_002
, ...table_999
.The correct table is accessed by key % 1000.
So a query might look as follows:
Before executing the query I format it with fmt.Sprintf(query, key).
Is there a way to do this in sqlc?
Beta Was this translation helpful? Give feedback.
All reactions