sqlkata / querybuilder

SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
https://sqlkata.com
MIT License
3.08k stars 498 forks source link

Is it possible to query temporal tables with "FOR SYSTEM_TIME?" #658

Closed mdnpascual closed 1 year ago

mdnpascual commented 1 year ago

I've been reading the docs and issues if anyone has tried using the query pattern FOR SYSTEM_TIME FROM <FromDate> TO <ToDate> with no luck

An example query would be:

"SELECT * FROM [sampleTable] FOR SYSTEM_TIME FROM '{fromDate.ToString()}' TO '{toDate.ToString()}' WHERE [sampleColumn] = @p0"

mdnpascual commented 1 year ago

Figured out I can use FromRaw and append the FOR SYSTEM_TIME FROM '{fromDate.ToString()}' TO '{toDate.ToString()}' to convert it to a temporal query