tina4ruby 3.13.126 → 3.13.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tina4/drivers/firebird_driver.rb +17 -11
- data/lib/tina4/drivers/mssql_driver.rb +14 -8
- data/lib/tina4/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0765c0228c99d3b8d5e26124c0afe5079ccc9ac675a3f067fc38e2e829bded7f
|
|
4
|
+
data.tar.gz: 6134c34d7f1ea98ea558862e1f98dbb0532b2d6fb3156b8bad5b9e129e362475
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0979843fa3654d0c48c62c19bbc8e5615a7b4b582286e14b3c517b76f3d9a50eb3246feb125b365b071c2c76adf7cdcbf93f802a576d75e5959d337cd19543c0'
|
|
7
|
+
data.tar.gz: f5ba6720f96dee12b2b7d751282fba8835771a11b368afafd64bf311c9ca1d8bf8501fd3b28493dd42126dfb0b4159a4c50a407422d5b8f63b680b7b67dbe038
|
|
@@ -230,18 +230,24 @@ module Tina4
|
|
|
230
230
|
rows.map { |row| decode_blobs(symbolize_keys(row)) }
|
|
231
231
|
end
|
|
232
232
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
233
|
+
# Translate SQLite-canonical SQL to Firebird at APPLY time, mirroring the
|
|
234
|
+
# Python master's firebird.py _translate_sql: strip AUTOINCREMENT (Firebird
|
|
235
|
+
# uses generators), bare TRUE/FALSE -> 1/0 (Firebird has no boolean type; a
|
|
236
|
+
# TRUE/FALSE INSIDE a string literal is data and is left untouched), rewrite
|
|
237
|
+
# the types Firebird rejects -- TEXT -> BLOB SUB_TYPE TEXT (-607), REAL ->
|
|
238
|
+
# DOUBLE PRECISION -- and drop CREATE TABLE IF NOT EXISTS. Every helper only
|
|
239
|
+
# touches DDL keywords or bare boolean tokens, so a plain
|
|
240
|
+
# INSERT/UPDATE/DELETE/SELECT is returned untouched. This is what lets a
|
|
241
|
+
# REALLY-generated migration (id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
242
|
+
# bio TEXT, price REAL) apply on Firebird instead of raising -607/-104.
|
|
243
|
+
def translate_sql(sql)
|
|
243
244
|
sql = Tina4::SQLTranslator.auto_increment_syntax(sql, "firebird")
|
|
244
|
-
sql = Tina4::SQLTranslator.
|
|
245
|
+
sql = Tina4::SQLTranslator.boolean_to_int(sql)
|
|
246
|
+
Tina4::SQLTranslator.ddl_types(sql, "firebird")
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
def execute(sql, params = [])
|
|
250
|
+
sql = translate_sql(sql)
|
|
245
251
|
result = with_reconnect do
|
|
246
252
|
if params.empty?
|
|
247
253
|
@connection.execute(sql)
|
|
@@ -58,15 +58,21 @@ module Tina4
|
|
|
58
58
|
rows
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
# Translate SQLite-canonical SQL to T-SQL at APPLY time, mirroring the
|
|
62
|
+
# Python master's mssql.py _translate_sql: AUTOINCREMENT -> IDENTITY(1,1),
|
|
63
|
+
# bare TRUE/FALSE -> 1/0 (MSSQL has BIT, not a boolean type; a TRUE/FALSE
|
|
64
|
+
# INSIDE a string literal is data and is left untouched), strip CREATE TABLE
|
|
65
|
+
# IF NOT EXISTS (not T-SQL) and map TIMESTAMP -> DATETIME2 (MSSQL's TIMESTAMP
|
|
66
|
+
# is a rowversion). Every helper only touches DDL keywords or bare boolean
|
|
67
|
+
# tokens, so a plain INSERT/UPDATE/DELETE/SELECT is returned untouched.
|
|
68
|
+
def translate_sql(sql)
|
|
68
69
|
sql = Tina4::SQLTranslator.auto_increment_syntax(sql, "mssql")
|
|
69
|
-
sql = Tina4::SQLTranslator.
|
|
70
|
+
sql = Tina4::SQLTranslator.boolean_to_int(sql)
|
|
71
|
+
Tina4::SQLTranslator.ddl_types(sql, "mssql")
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def execute(sql, params = [])
|
|
75
|
+
sql = translate_sql(sql)
|
|
70
76
|
effective_sql = interpolate_params(sql, params)
|
|
71
77
|
|
|
72
78
|
# Capture the generated IDENTITY AT WRITE TIME — mirror of the Python
|
data/lib/tina4/version.rb
CHANGED