midb 1.0.1 → 1.0.2
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/midb/server_model.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e428c00026f3333fa8bb23fd7ce75bcff96a787
|
4
|
+
data.tar.gz: 0d753dcb1bd8d12d96b19f5f01cf05b143092646
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07ab87e9c975ed55a6c86dbafec73de7a81691ab4d6fa8b218e8d7d72c871d0575b4634bf46f28fa26426d4d2c315749d31bebeb94f2333ce5be6d5ce77d4db0
|
7
|
+
data.tar.gz: cea9b182ee96b4ede9be33d1347c32bf8bad112249b0742449144019cfa551b71422d1e3399875fe07cfc32af6a244835b277a0d744a670176a3f25c49cc5cdc
|
data/lib/midb/server_model.rb
CHANGED
@@ -65,7 +65,7 @@ module MIDB
|
|
65
65
|
matching_field = match.split("->")[0]
|
66
66
|
row_field = match.split("->")[1]
|
67
67
|
fields[table].push matching_field
|
68
|
-
if MIDB::ServerController.config["dbengine"] ==
|
68
|
+
if MIDB::ServerController.config["dbengine"] == :mysql
|
69
69
|
inserts[table].push "(SELECT #{row_field} FROM #{main_table} WHERE id=(SELECT LAST_INSERT_ID()))"
|
70
70
|
else
|
71
71
|
inserts[table].push "(SELECT #{row_field} FROM #{main_table} WHERE id=(last_insert_rowid()))"
|
@@ -84,7 +84,7 @@ module MIDB
|
|
84
84
|
# Find the ID to return in the response (only for the first query)
|
85
85
|
queries.each do |q|
|
86
86
|
results.push dbe.query(dblink, q)
|
87
|
-
if MIDB::ServerController.config["dbengine"] ==
|
87
|
+
if MIDB::ServerController.config["dbengine"] == :mysql
|
88
88
|
rid ||= dbe.extract(dbe.query(dblink, "SELECT id FROM #{main_table} WHERE id=(SELECT LAST_INSERT_ID());"), "id")
|
89
89
|
else
|
90
90
|
rid ||= dbe.extract(dbe.query(dblink, "SELECT id FROM #{main_table} WHERE id=(last_insert_rowid());"), "id")
|