lqs / sqlingo

💥 A lightweight DSL & ORM which helps you to write SQL in Go.
MIT License
415 stars 28 forks source link

Need to insert comment or fragment in sql #17

Open canuran opened 1 year ago

canuran commented 1 year ago

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: db.SelectFrom(User).AddFrag(Frag("/* shard_id=1 */").BeforeWhere()).Where(...)....