-
Hello, I am not a user of this library but looking to learn a few tricks from what you are doing (which is often how I end up a user of a library that is new to me). I searched Google, and see a couple people asking for "sql generated from linqtodb" but the answer is not quite so simple. For example: #3413 -- suggests a way to get SQL for multiple different providers - which is a neat idea I bookmarked, but still don't see the actual answer I am looking for If I understand what DataConnection.WriteTraceLine is doing, it's going to log the SQL as its sent to the downstream Sql Client driver library. I would rather just use the SQL abstraction parts of LinqToDb, without the need to use a particular client driver - and just store the SQL it generates. As an example use case, I want to train a large language model some SQL tricks and score the effectiveness of the tricks using RLFH. I really don't want the overhead of an actual database connection. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Generate SQL for which purposes? var query =
from q in db.GetTable<Some>()
where q.Id == 1
select q;
var sql = query.ToString(); It is possible to generate query without |
Beta Was this translation helpful? Give feedback.
Generate SQL for which purposes?
Usually you can just write LINQ query and call
ToString()
It is possible to generate query without
DataConnection
but i need to understand why.