Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Information Schema to Sql Server #1

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
81a8080
Port Information Schema to Sql Server
sudqijawabreh Apr 3, 2021
aeeb391
Use DustyTables and Throwaway instead of postgres packages
sudqijawabreh Apr 9, 2021
165f1a1
Replace bigserial and serial with int and bigint using identity keyword
sudqijawabreh Apr 10, 2021
cb75307
Use nvarchar instead of text and text[]
sudqijawabreh Apr 10, 2021
dfe6220
Remove sql client error in Test file
sudqijawabreh Apr 10, 2021
53ae2b0
Fixing some unit tests
sudqijawabreh Apr 10, 2021
753714e
Remove "@" character from paramater names to be compatabile with pars…
sudqijawabreh Apr 10, 2021
d9a8a38
Fix semanticAnalysis-missingParameter code because missing column tes…
sudqijawabreh Apr 10, 2021
f9093ca
Fix semanticAnalysis-typeMistmatch code because missing column test e…
sudqijawabreh Apr 10, 2021
4d1744e
Remove Returning from update statement because it is not needed and n…
sudqijawabreh Apr 10, 2021
e1be54f
order unbound vars in ReWriteSqlStatementToEnableMoreThanOneParameter…
sudqijawabreh Apr 11, 2021
62068d6
Fix test type mismatch with comparing against non-nullable column dur…
sudqijawabreh Apr 11, 2021
eb70eef
Fix column type name when extracting output columns
sudqijawabreh Apr 11, 2021
eb9dc7a
Bit is the same as as boolean in tsql when providing parameters
sudqijawabreh Apr 11, 2021
1ded3f4
Fix insert queries in tests
sudqijawabreh Apr 11, 2021
4411fd7
Use output instead of Return
sudqijawabreh Apr 11, 2021
c4356f0
Remove array tests
sudqijawabreh Apr 11, 2021
f246511
Port some tests to work on MS SQL
sudqijawabreh Aug 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test type mismatch with comparing against non-nullable column dur…
…ing UPDATE
sudqijawabreh authored and falfaddaghi committed Feb 12, 2022
commit 62068d6a2bcb5abd0f625e3482ee7950603abe1e
4 changes: 2 additions & 2 deletions src/NpgsqlFSharpAnalyzer.Core/SqlAnalysis.fs
Original file line number Diff line number Diff line change
@@ -684,7 +684,7 @@ module SqlAnalysis =
if providedParam.paramFunc <> "Sql.jsonb"
then yield typeMismatch [ "Sql.jsonb" ]

| ("text"|"json"|"xml") ->
| ("text"|"json"|"xml"|"nvarchar"|"varchar") ->
if requiredParam.IsNullable then
if providedParam.paramFunc <> "Sql.text" && providedParam.paramFunc <> "Sql.textOrNone" && providedParam.paramFunc <> "Sql.string" && providedParam.paramFunc <> "Sql.textOrNone" && providedParam.paramFunc <> "Sql.dbnull"
then yield typeMismatch [ "Sql.text"; "Sql.string"; "Sql.textOrNone"; "Sql.stringOrNone"; "Sql.dbnull" ]
@@ -811,7 +811,7 @@ module SqlAnalysis =
yield typeMismatch [ "Sql.readBool" ]
| ("text"|"json"|"xml"|"jsonb") when attempt.funcName <> "Sql.readString" ->
yield typeMismatch [ "Sql.readString" ]
| ("character varying"|"character"|"char"|"varchar"|"citext") when attempt.funcName <> "Sql.readString" ->
| ("character varying"|"character"|"char"|"nvarchar"|"varchar"|"citext") when attempt.funcName <> "Sql.readString" ->
yield typeMismatch [ "Sql.readString" ]
| ("int" | "int2" | "int4" | "smallint" | "integer") when attempt.funcName <> "Sql.readInt" ->
yield typeMismatch [ "Sql.readInt" ]
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ open System

let [<Literal>] updateUsernameQuery = """
UPDATE users
SET username = @username, last_login = @last_login
SET username = @username
WHERE user_id = @user_id
"""

@@ -16,6 +16,5 @@ let usersAndTheirRoles connectionString =
|> Sql.parameters [
"@user_id", Sql.intOrNone (Some 10)
"@username", Sql.textOrNone (Some "John")
"@last_login", Sql.timestamptz DateTime.Now
]
|> Sql.execute (fun read -> read.int "user_id")
|> Sql.executeNonQuery