Start handling ids as numbers, rather than strings
squee, returns all data as strings, and expects strings as inputs to queries. So, keeping the ids as strings was easy initially, but it means that you can't tell from the type whether it should be quoted, or not... Therefore, handle ids as strings, converting them to numbers when they're fetched from the database, and back to strings as part of the queries.
This commit is contained in:
parent
6c90fe4324
commit
d3913a14d5
10 changed files with 82 additions and 75 deletions
|
|
@ -18,7 +18,7 @@
|
|||
conn
|
||||
(lambda (conn)
|
||||
(match (lint-warning-message-data->lint-warning-message-ids conn data)
|
||||
(((? string? id1) (? string? id2))
|
||||
(((? number? id1) (? number? id2))
|
||||
#t)))
|
||||
#:always-rollback? #t))
|
||||
|
||||
|
|
@ -27,11 +27,11 @@
|
|||
conn
|
||||
(lambda (conn)
|
||||
(match (lint-warning-message-data->lint-warning-message-ids conn data)
|
||||
(((? string? id1) (? string? id2))
|
||||
(((? number? id1) (? number? id2))
|
||||
(match (lint-warning-message-data->lint-warning-message-ids conn data)
|
||||
(((? string? second-id1) (? string? second-id2))
|
||||
(and (string=? id1 second-id1)
|
||||
(string=? id2 second-id2)))))))
|
||||
(((? number? second-id1) (? number? second-id2))
|
||||
(and (eq? id1 second-id1)
|
||||
(eq? id2 second-id2)))))))
|
||||
#:always-rollback? #t))
|
||||
|
||||
(test-assert "single set insert"
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
conn
|
||||
(lambda (conn)
|
||||
(match (lint-warning-message-data->lint-warning-message-set-id conn data)
|
||||
((? string? id1)
|
||||
((? number? id1)
|
||||
#t)))
|
||||
#:always-rollback? #t))
|
||||
|
||||
|
|
@ -48,10 +48,10 @@
|
|||
conn
|
||||
(lambda (conn)
|
||||
(match (lint-warning-message-data->lint-warning-message-set-id conn data)
|
||||
((? string? id)
|
||||
((? number? id)
|
||||
(match (lint-warning-message-data->lint-warning-message-set-id conn data)
|
||||
((? string? second-id)
|
||||
(string=? id second-id))))))
|
||||
((? number? second-id)
|
||||
(eq? id second-id))))))
|
||||
#:always-rollback? #t))))
|
||||
|
||||
(test-end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue