SqlHydra is a suite of NuGet packages for working with databases in F# including code generation tools and query expressions.
MIT License
Bot releases are hidden (Show)
Published by JordanMarr over 1 year ago
Adds support in select
statement where
clauses for reversing order of column/value. Previously, the table column/property always had to be on left side of the comparison:
select {
for a in addressTable do
where (a.AddressID > 5)
}
Now it can be on either side:
select {
for a in addressTable do
where (5 < a.AddressID && a.AddressID <= 20)
}
Thanks to @ntwilson for this improvement! 🎉
Published by JordanMarr almost 2 years ago
v1.1.1 updates all the SqlHydra code generator tools to simplify the TOML configuration wizard that runs when a TOML file is not detected.
This update establishes three main "use cases" supported by SqlHydra.
Please see the updated TOML wiki page for more details:
https://github.com/JordanMarr/SqlHydra/wiki/TOML-Configuration#generating-toml-file
Published by JordanMarr almost 2 years ago
select
queries now use table aliases instead of fully qualified table names (required to support same table joins).inSchema
function is no longer needed (now deprecated/obsolete because schema can be inferred from generated types parent module).
select {
for order in table<dbo.Orders> do
select token
}
Thanks to @jwosty for his huge contributions toward the same table join feature!
Published by JordanMarr almost 2 years ago
SqlHydra.Query v1.0.5 adds support for F# implicit conversions in where
expressions.
Example 1: Comparing a decimal
value (p.ListPrice
) with an int
constant now works as expected:
select {
for p in productTable do
where (p.ListPrice > 5)
}
Example 2: Comparing a decimal option
(p.Weight
) with an int
constant now works as expected:
select {
for p in productTable do
where (p.Weight = Some 5)
}
Thanks to aciq for his awesome pull request!
Published by JordanMarr almost 2 years ago
SqlHydra.Npgsql v1.0.5 adds adds support for arrays for the remaining PostgreSQL primitive data types, including:
Published by JordanMarr almost 2 years ago
SqlHydra.Npgsql v1.0.4 adds support for text[]
and integer[]
columns.
There are other types that can support arrays, but I wanted to add the requested types first.
If you would like to see more array types added, please post an issue that we can use to come up with a more comprehensive list.
Published by JordanMarr about 2 years ago
Fixes getId
for SQL Server inserts when using GUID/UNIQUEIDENTIFIER column.
https://github.com/JordanMarr/SqlHydra/issues/38
Published by JordanMarr about 2 years ago
This release affects SqlHydra.SqlServer and SqlHydra.Query so that the SQL Server DATETIME2 parameter type is properly detected and set based on the generated types. (Previously, DATETIME2
columns were being set as DATETIME
parameter types which caused a loss of precision.)
ProviderDbType
attribute for DateTime
fields with either DATETIME
or DATETIME2
.ProviderDbType
has now been fixed to check for generated ProviderDbType
attributes in both where
and having
parameters as well as in updates and inserts.Thanks to @ntwilson for contributing this fix!
Published by JordanMarr over 2 years ago
Published by JordanMarr over 2 years ago
DateOnly
parameter values to DateTime
GetDateOnly
extension methodGetDateOnly
extension methodGetDateOnly
extension methodGetDateOnly
extension method#if NET6_0
conditionals to #if NET6_0_OR_GREATER
Published by JordanMarr over 2 years ago
SqlHydra.Npgsql 1.0.0 used Npgsql v6.0.3 which had a bug that throws an exception during SqlHydra.Npgsql code generation if an enum exists an a schema other than public. This bug has been fixed in Npgsql v6.0.4.
SqlHydra.Npgsql 1.0.1 now uses Npgsql v6.0.4.
Published by JordanMarr over 2 years ago
Added the following new operators to the insert
, insertAsync
and insertTask
builders
(requires: open SqlHydra.Query.NpgsqlExtensions
):
onConflictDoUpdate
onConflictDoNothing
Added the following new operators to the insert
, insertAsync
and insertTask
builders
(requires: open SqlHydra.Query.SqliteExtensions
):
onConflictDoUpdate
onConflictDoNothing
insertOrReplace
See examples in readme:
https://github.com/JordanMarr/SqlHydra#upsert
Published by JordanMarr over 2 years ago
Published by JordanMarr over 2 years ago
The overarching goal of this release was to make cleaner, prettier query builders that are:
selectAsync
selectTask
updateAsync
updateTask
insertAsync
insertTask
deleteAsync
deleteTask
toList
toArray
mapList
mapArray
mapSeq
The new builders can automatically execute without manually piping into the QueryBuilder
methods.
This along with the new mapList
, mapArray
and mapSeq
methods makes the queries expressions completely self-contained.
QueryContext
and Connection Scope HandlingThe QueryContext
must be passed into the new builders as either Create
which takes a function that initializes a new QueryContext
and automatically disposes it when its done , or Shared
which uses an already initialized context.
Using the Create
context type makes it now possible to have self-contained query functions that do not need to be wrapped in a task
or async
block, which looks so much cleaner!
Published by JordanMarr over 2 years ago
All SqlHydra generators now support both .NET 5 and .NET 6!
This includes the new .NET 6 types, System.DateOnly
and System.TimeOnly
.
See readme for details.
json
and jsonb
data types with Npgsql (and new attribute subsystem for overriding the parameter type in the generated types which is now available to be used by all providers).entities
operation now takes new AtLeastOne
type as input.QueryContext
to add support for passing CancellationToken
:
GetReaderAsyncWithOptions
ReadAsyncWithOptions
ReadOneAsyncWithOptions
InsertAsyncWithOptions
DeleteAsyncWithOptions
CountAsyncWithOptions