Skip to content

Commit

Permalink
With C# driver libraries, always deal with nulls :-(
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorium committed Oct 21, 2023
1 parent 6a8ba05 commit 42188da
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/SQLProvider.Runtime/Providers.Firebird.fs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ module Firebird =
if e.Types.Length = 0 then
failwith errmsg
else e.Types, Some errmsg
match types |> Array.tryFind(fun t -> t.Name = name) with
match types |> Array.tryFind(fun t -> (not (isNull t)) && t.Name = name) with
| Some t -> t
| None ->
match err with
Expand Down
2 changes: 1 addition & 1 deletion src/SQLProvider.Runtime/Providers.MsSqlServer.Dynamic.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module MSSqlServerDynamic =
if e.Types.Length = 0 then
failwith errmsg
else e.Types, Some errmsg
match types |> Array.tryFind(fun t -> t.Name = name) with
match types |> Array.tryFind(fun t -> (not (isNull t)) && t.Name = name) with
| Some t -> t
| None ->
match err with
Expand Down
2 changes: 1 addition & 1 deletion src/SQLProvider.Runtime/Providers.MySql.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module MySql =
if e.Types.Length = 0 then
failwith errmsg
else e.Types, Some errmsg
match types |> Array.tryFind(fun t -> t.Name = name) with
match types |> Array.tryFind(fun t -> (not (isNull t)) && t.Name = name) with
| Some t -> t
| None ->
match err with
Expand Down
4 changes: 2 additions & 2 deletions src/SQLProvider.Runtime/Providers.Oracle.fs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module internal Oracle =
if e.Types.Length = 0 then
failwith errmsg
else e.Types, Some errmsg
match types |> Array.tryFind(fun t -> t.Name = name) with
match types |> Array.tryFind(fun t -> (not (isNull t)) && t.Name = name) with
| Some t -> t
| None ->
match err with
Expand Down Expand Up @@ -293,7 +293,7 @@ module internal Oracle =
IsPrimaryKey = pkColumn
IsNullable = nullable
IsAutonumber = pkColumn
HasDefault = row.[4] <> null
HasDefault = not (isNull row.[4])
IsComputed = false
TypeInfo = ValueSome typeinfo }
))
Expand Down
2 changes: 1 addition & 1 deletion src/SQLProvider.Runtime/Providers.Postgresql.fs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module PostgreSQL =
if e.Types.Length = 0 then
failwith errmsg
else e.Types, Some errmsg
match types |> Array.tryFind(fun t -> t.Name = name) with
match types |> Array.tryFind(fun t -> (not (isNull t)) && t.Name = name) with
| Some t -> Some t
| None ->
match err with
Expand Down
2 changes: 1 addition & 1 deletion src/SQLProvider.Runtime/Providers.SQLite.fs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ type internal SQLiteProvider(resolutionPath, contextSchemaPath, referencedAssemb
if e.Types.Length = 0 then
failwith errmsg
else e.Types, Some errmsg
match types |> Array.tryFind f with
match types |> Array.filter(fun t -> not (isNull t)) |> Array.tryFind f with
| Some t -> t
| None ->
match err with
Expand Down

0 comments on commit 42188da

Please sign in to comment.