jet
jet copied to clipboard
How to insert comment or fragment in sql?
Such as select name from user /* shard_id=1 */ where name like 'can%'
, the shard_id comment is to tell the database proxy how to route to the sharded database.
Suggest: SELECT(User.Name).FROM(User).FRAG(FRAG("/* shard_id=1 */").BeforeWhere()).WHERE(...)
Hi @canuran Can you use optimizer hints instead?
Hi @canuran Can you use optimizer hints instead?
It seems impossible, optimizer_hints can only be used for mysql and the format is fixed, not suitable for prompting db proxy.
What database proxy are you using? Does a comment have to appear at a specific position inside the statement?