baza 0.0.20 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +84 -0
  3. data/.rubocop_todo.yml +17 -135
  4. data/.travis.yml +21 -0
  5. data/Gemfile +10 -7
  6. data/Gemfile.lock +39 -44
  7. data/README.md +61 -3
  8. data/VERSION +1 -1
  9. data/baza.gemspec +146 -98
  10. data/config/best_project_practice_rubocop.yml +8 -0
  11. data/config/best_project_practice_rubocop_todo.yml +6 -0
  12. data/lib/baza.rb +8 -12
  13. data/lib/baza/base_sql_driver.rb +198 -52
  14. data/lib/baza/cloner.rb +1 -0
  15. data/lib/baza/column.rb +26 -0
  16. data/lib/baza/database.rb +19 -3
  17. data/lib/baza/db.rb +69 -271
  18. data/lib/baza/driver.rb +1 -6
  19. data/lib/baza/{drivers → driver}/active_record.rb +65 -21
  20. data/lib/baza/{drivers → driver}/active_record/columns.rb +0 -0
  21. data/lib/baza/driver/active_record/commands.rb +10 -0
  22. data/lib/baza/driver/active_record/databases.rb +10 -0
  23. data/lib/baza/{drivers → driver}/active_record/indexes.rb +0 -0
  24. data/lib/baza/{drivers → driver}/active_record/result.rb +3 -1
  25. data/lib/baza/{drivers → driver}/active_record/tables.rb +0 -0
  26. data/lib/baza/driver/active_record/users.rb +12 -0
  27. data/lib/baza/{drivers → driver}/mysql.rb +9 -26
  28. data/lib/baza/{drivers → driver}/mysql/column.rb +14 -35
  29. data/lib/baza/{drivers → driver}/mysql/columns.rb +9 -12
  30. data/lib/baza/driver/mysql/commands.rb +39 -0
  31. data/lib/baza/driver/mysql/database.rb +64 -0
  32. data/lib/baza/driver/mysql/databases.rb +63 -0
  33. data/lib/baza/{drivers → driver}/mysql/index.rb +0 -0
  34. data/lib/baza/{drivers → driver}/mysql/indexes.rb +0 -0
  35. data/lib/baza/{drivers → driver}/mysql/result.rb +15 -7
  36. data/lib/baza/{drivers → driver}/mysql/sqlspecs.rb +0 -0
  37. data/lib/baza/{drivers → driver}/mysql/table.rb +27 -43
  38. data/lib/baza/{drivers → driver}/mysql/tables.rb +5 -34
  39. data/lib/baza/{drivers → driver}/mysql/unbuffered_result.rb +8 -2
  40. data/lib/baza/driver/mysql/user.rb +22 -0
  41. data/lib/baza/driver/mysql/users.rb +39 -0
  42. data/lib/baza/{drivers → driver}/mysql2.rb +19 -49
  43. data/lib/baza/{drivers → driver}/mysql2/column.rb +0 -0
  44. data/lib/baza/{drivers → driver}/mysql2/columns.rb +0 -0
  45. data/lib/baza/driver/mysql2/commands.rb +2 -0
  46. data/lib/baza/{drivers → driver}/mysql2/database.rb +0 -0
  47. data/lib/baza/{drivers → driver}/mysql2/databases.rb +0 -0
  48. data/lib/baza/{drivers → driver}/mysql2/index.rb +0 -0
  49. data/lib/baza/{drivers → driver}/mysql2/indexes.rb +0 -0
  50. data/lib/baza/{drivers → driver}/mysql2/result.rb +3 -1
  51. data/lib/baza/{drivers → driver}/mysql2/table.rb +0 -0
  52. data/lib/baza/{drivers → driver}/mysql2/tables.rb +0 -0
  53. data/lib/baza/driver/mysql2/user.rb +2 -0
  54. data/lib/baza/driver/mysql2/users.rb +2 -0
  55. data/lib/baza/{drivers → driver}/mysql_java.rb +60 -38
  56. data/lib/baza/{drivers → driver}/mysql_java/column.rb +0 -0
  57. data/lib/baza/{drivers → driver}/mysql_java/columns.rb +0 -0
  58. data/lib/baza/driver/mysql_java/commands.rb +2 -0
  59. data/lib/baza/driver/mysql_java/database.rb +2 -0
  60. data/lib/baza/driver/mysql_java/databases.rb +2 -0
  61. data/lib/baza/{drivers → driver}/mysql_java/index.rb +0 -0
  62. data/lib/baza/{drivers → driver}/mysql_java/indexes.rb +0 -0
  63. data/lib/baza/{drivers → driver}/mysql_java/table.rb +0 -0
  64. data/lib/baza/{drivers → driver}/mysql_java/tables.rb +0 -0
  65. data/lib/baza/driver/mysql_java/user.rb +2 -0
  66. data/lib/baza/driver/mysql_java/users.rb +2 -0
  67. data/lib/baza/driver/pg.rb +80 -0
  68. data/lib/baza/driver/pg/column.rb +125 -0
  69. data/lib/baza/driver/pg/columns.rb +37 -0
  70. data/lib/baza/driver/pg/commands.rb +35 -0
  71. data/lib/baza/driver/pg/create_index_sql_creator.rb +51 -0
  72. data/lib/baza/driver/pg/database.rb +89 -0
  73. data/lib/baza/driver/pg/databases.rb +79 -0
  74. data/lib/baza/driver/pg/index.rb +35 -0
  75. data/lib/baza/driver/pg/indexes.rb +5 -0
  76. data/lib/baza/driver/pg/result.rb +139 -0
  77. data/lib/baza/driver/pg/table.rb +184 -0
  78. data/lib/baza/driver/pg/tables.rb +45 -0
  79. data/lib/baza/{drivers → driver}/sqlite3.rb +6 -24
  80. data/lib/baza/{drivers → driver}/sqlite3/column.rb +22 -24
  81. data/lib/baza/{drivers → driver}/sqlite3/columns.rb +6 -6
  82. data/lib/baza/driver/sqlite3/commands.rb +28 -0
  83. data/lib/baza/{drivers → driver}/sqlite3/database.rb +0 -0
  84. data/lib/baza/{drivers → driver}/sqlite3/databases.rb +0 -1
  85. data/lib/baza/{drivers → driver}/sqlite3/index.rb +0 -0
  86. data/lib/baza/{drivers → driver}/sqlite3/indexes.rb +0 -0
  87. data/lib/baza/{drivers → driver}/sqlite3/result.rb +14 -6
  88. data/lib/baza/{drivers → driver}/sqlite3/sqlspecs.rb +0 -0
  89. data/lib/baza/{drivers → driver}/sqlite3/table.rb +25 -16
  90. data/lib/baza/{drivers → driver}/sqlite3/tables.rb +5 -6
  91. data/lib/baza/{drivers → driver}/sqlite3/unbuffered_result.rb +8 -2
  92. data/lib/baza/{drivers → driver}/sqlite3_java.rb +13 -23
  93. data/lib/baza/{drivers → driver}/sqlite3_java/column.rb +0 -0
  94. data/lib/baza/{drivers → driver}/sqlite3_java/columns.rb +0 -0
  95. data/lib/baza/driver/sqlite3_java/commands.rb +2 -0
  96. data/lib/baza/{drivers → driver}/sqlite3_java/database.rb +0 -0
  97. data/lib/baza/{drivers → driver}/sqlite3_java/index.rb +0 -0
  98. data/lib/baza/{drivers → driver}/sqlite3_java/indexes.rb +0 -0
  99. data/lib/baza/{drivers → driver}/sqlite3_java/table.rb +0 -0
  100. data/lib/baza/{drivers → driver}/sqlite3_java/tables.rb +0 -0
  101. data/lib/baza/{drivers → driver}/sqlite3_java/unbuffered_result.rb +14 -9
  102. data/lib/baza/{drivers → driver}/sqlite3_rhodes.rb +6 -24
  103. data/lib/baza/errors.rb +2 -0
  104. data/lib/baza/idquery.rb +15 -8
  105. data/lib/baza/index.rb +7 -0
  106. data/lib/baza/jdbc_driver.rb +4 -16
  107. data/lib/baza/jdbc_result.rb +20 -12
  108. data/lib/baza/mysql_base_driver.rb +7 -7
  109. data/lib/baza/query_buffer.rb +20 -19
  110. data/lib/baza/row.rb +16 -16
  111. data/lib/baza/sql_queries.rb +3 -0
  112. data/lib/baza/sql_queries/generic_insert.rb +81 -0
  113. data/lib/baza/sql_queries/generic_update.rb +31 -0
  114. data/lib/baza/sql_queries/mysql_upsert.rb +52 -0
  115. data/lib/baza/sql_queries/mysql_upsert_duplicate_key.rb +57 -0
  116. data/lib/baza/sql_queries/non_atomic_upsert.rb +25 -0
  117. data/lib/baza/sql_queries/postgres_upsert_duplicate_key.rb +118 -0
  118. data/lib/baza/sql_queries/select.rb +170 -0
  119. data/lib/baza/sql_queries/sqlite_upsert_duplicate_key.rb +99 -0
  120. data/lib/baza/table.rb +35 -8
  121. data/spec/active_record/models/user.rb +3 -0
  122. data/spec/{cloner_spec.rb → baza/cloner_spec.rb} +0 -0
  123. data/spec/drivers/active_record_mysql2_spec.rb +5 -3
  124. data/spec/drivers/active_record_mysql_spec.rb +2 -1
  125. data/spec/drivers/active_record_pg_spec.rb +20 -0
  126. data/spec/drivers/active_record_sqlite3_spec.rb +2 -1
  127. data/spec/drivers/mysql2_spec.rb +1 -1
  128. data/spec/drivers/mysql_spec.rb +10 -10
  129. data/spec/drivers/pg_spec.rb +18 -0
  130. data/spec/drivers/sqlite3_spec.rb +7 -8
  131. data/spec/info_active_record_example.rb +1 -1
  132. data/spec/{info_active_record_mysql2.rb → info_active_record_mysql2_example.rb} +3 -2
  133. data/spec/info_active_record_mysql2_travis.rb +35 -0
  134. data/spec/{info_active_record_mysql.rb → info_active_record_mysql_example.rb} +5 -4
  135. data/spec/info_active_record_mysql_travis.rb +36 -0
  136. data/spec/info_active_record_pg_example.rb +36 -0
  137. data/spec/info_active_record_pg_travis.rb +34 -0
  138. data/spec/info_active_record_sqlite3.rb +1 -1
  139. data/spec/info_mysql2_example.rb +1 -3
  140. data/spec/{info_mysql2_shippable.rb → info_mysql2_travis.rb} +2 -4
  141. data/spec/info_mysql_example.rb +1 -3
  142. data/spec/{info_mysql_shippable.rb → info_mysql_travis.rb} +2 -4
  143. data/spec/info_pg_example.rb +22 -0
  144. data/spec/info_pg_travis.rb +20 -0
  145. data/spec/info_sqlite3.rb +1 -3
  146. data/spec/spec_helper.rb +1 -1
  147. data/spec/support/driver_active_record_collection.rb +62 -0
  148. data/spec/support/driver_collection.rb +136 -121
  149. data/spec/support/driver_columns_collection.rb +19 -10
  150. data/spec/support/driver_databases_collection.rb +23 -1
  151. data/spec/support/driver_indexes_collection.rb +2 -2
  152. data/spec/support/driver_tables_collection.rb +24 -4
  153. data/spec/support/driver_users_collection.rb +53 -0
  154. metadata +185 -104
  155. data/lib/baza/drivers/mysql/database.rb +0 -28
  156. data/lib/baza/drivers/mysql/databases.rb +0 -35
  157. data/lib/baza/drivers/mysql_java/database.rb +0 -2
  158. data/lib/baza/drivers/mysql_java/databases.rb +0 -2
  159. data/lib/baza/model.rb +0 -875
  160. data/lib/baza/model_custom.rb +0 -155
  161. data/lib/baza/model_handler.rb +0 -910
  162. data/lib/baza/model_handler_sqlhelper.rb +0 -484
  163. data/lib/baza/revision.rb +0 -383
  164. data/shippable.yml +0 -17
  165. data/spec/info_active_record_mysql2_shippable.rb +0 -34
  166. data/spec/info_active_record_mysql_shippable.rb +0 -34
  167. data/spec/model_handler_spec.rb +0 -431
@@ -47,11 +47,11 @@ shared_examples_for "a baza indexes driver" do
47
47
 
48
48
  describe "#unique?" do
49
49
  it "returns true when it is unique" do
50
- test_table.index("email").unique?.should eq true
50
+ expect(test_table.index("email").unique?).to eq true
51
51
  end
52
52
 
53
53
  it "returns false when it isn't unique" do
54
- test_table.index("text").unique?.should eq false
54
+ expect(test_table.index("text").unique?).to eq false
55
55
  end
56
56
  end
57
57
  end
@@ -4,10 +4,13 @@ shared_examples_for "a baza tables driver" do
4
4
  let(:db) { driver.db }
5
5
  let(:db2) { driver2.db }
6
6
  let(:test_table) do
7
- db.tables.create("test", columns: [
8
- {name: "id", type: :int, autoincr: true, primarykey: true},
9
- {name: "text", type: :varchar}
10
- ])
7
+ db.tables.create(
8
+ "test",
9
+ columns: [
10
+ {name: "id", type: :int, autoincr: true, primarykey: true},
11
+ {name: "text", type: :varchar}
12
+ ]
13
+ )
11
14
  db.tables[:test]
12
15
  end
13
16
 
@@ -34,6 +37,22 @@ shared_examples_for "a baza tables driver" do
34
37
  # FIXME: How to validate?
35
38
  end
36
39
 
40
+ it "#rows_count" do
41
+ expect(test_table.rows_count).to eq 0
42
+ test_table.insert(text: "Test")
43
+ expect(test_table.rows_count).to eq 1
44
+ end
45
+
46
+ it "#native?" do
47
+ expect(test_table.native?).to eq false
48
+ end
49
+
50
+ it "#row" do
51
+ expect { test_table.row(500) }.to raise_error(Baza::Errors::RowNotFound)
52
+ test_table.insert(id: 1, text: "Test")
53
+ expect(test_table.row(1)[:text]).to eq "Test"
54
+ end
55
+
37
56
  it "#truncate" do
38
57
  test_table
39
58
 
@@ -52,6 +71,7 @@ shared_examples_for "a baza tables driver" do
52
71
  it "#clone" do
53
72
  test_table
54
73
  test_table.create_indexes([{name: "index_on_text", columns: ["text"]}])
74
+
55
75
  expect(test_table.indexes.length).to eq 1
56
76
 
57
77
  test_table.insert(text: "test1")
@@ -0,0 +1,53 @@
1
+ require "spec_helper"
2
+
3
+ shared_examples_for "a baza users driver" do
4
+ let(:driver) { constant.new }
5
+ let(:db) { driver.db }
6
+ let(:test_user_name) { "baza-test-create" }
7
+ let(:user) { db.users.create(name: test_user_name, host: "localhost", password: "mypassword") }
8
+
9
+ before do
10
+ # Drop any existing user with the test user name
11
+ begin
12
+ db.users.find_by_name(test_user_name).drop
13
+ rescue Baza::Errors::UserNotFound # rubocop:disable Lint/HandleExceptions
14
+ end
15
+ end
16
+
17
+ it "Users#list" do
18
+ root_found = false
19
+ db.users.list do |user|
20
+ if user.name == "root"
21
+ root_found = true
22
+ break
23
+ end
24
+ end
25
+
26
+ expect(root_found).to eq true
27
+ end
28
+
29
+ it "Users#find_by_name" do
30
+ root_user = db.users.find_by_name("root")
31
+ expect(root_user.name).to eq "root"
32
+ end
33
+
34
+ it "Users#create" do
35
+ my_user = db.users.create(name: test_user_name, host: "localhost", password: "mypassword")
36
+
37
+ expect(my_user.name).to eq test_user_name
38
+ expect(my_user.host).to eq "localhost"
39
+ end
40
+
41
+ it "User#drop" do
42
+ user.drop
43
+ expect { db.users.find_by_name(test_user_name) }.to raise_error(Baza::Errors::UserNotFound)
44
+ end
45
+
46
+ it "User#name" do
47
+ expect(user.name).to eq test_user_name
48
+ end
49
+
50
+ it "User#host" do
51
+ expect(user.host).to eq "localhost"
52
+ end
53
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baza
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Johansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-30 00:00:00.000000000 Z
11
+ date: 2016-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: datet
@@ -25,75 +25,103 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.0.25
27
27
  - !ruby/object:Gem::Dependency
28
- name: wref
28
+ name: array_enumerator
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.8
33
+ version: 0.0.10
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.8
40
+ version: 0.0.10
41
41
  - !ruby/object:Gem::Dependency
42
- name: array_enumerator
42
+ name: auto_autoloader
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.10
47
+ version: 0.0.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.10
54
+ version: 0.0.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: event_handler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.0.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.0.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: simple_delegate
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.0.2
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.0.2
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: string-cases
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
87
  - - "~>"
60
88
  - !ruby/object:Gem::Version
61
- version: 0.0.1
89
+ version: 0.0.4
62
90
  type: :runtime
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
94
  - - "~>"
67
95
  - !ruby/object:Gem::Version
68
- version: 0.0.1
96
+ version: 0.0.4
69
97
  - !ruby/object:Gem::Dependency
70
- name: event_handler
98
+ name: wref
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
101
  - - "~>"
74
102
  - !ruby/object:Gem::Version
75
- version: 0.0.0
103
+ version: 0.0.8
76
104
  type: :runtime
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
108
  - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: 0.0.0
110
+ version: 0.0.8
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: rspec
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
- - - ">="
115
+ - - '='
88
116
  - !ruby/object:Gem::Version
89
- version: '0'
117
+ version: 3.4.0
90
118
  type: :development
91
119
  prerelease: false
92
120
  version_requirements: !ruby/object:Gem::Requirement
93
121
  requirements:
94
- - - ">="
122
+ - - '='
95
123
  - !ruby/object:Gem::Version
96
- version: '0'
124
+ version: 3.4.0
97
125
  - !ruby/object:Gem::Dependency
98
126
  name: rdoc
99
127
  requirement: !ruby/object:Gem::Requirement
@@ -210,30 +238,44 @@ dependencies:
210
238
  name: mysql
211
239
  requirement: !ruby/object:Gem::Requirement
212
240
  requirements:
213
- - - ">="
241
+ - - '='
214
242
  - !ruby/object:Gem::Version
215
- version: '0'
243
+ version: 2.9.1
216
244
  type: :development
217
245
  prerelease: false
218
246
  version_requirements: !ruby/object:Gem::Requirement
219
247
  requirements:
220
- - - ">="
248
+ - - '='
221
249
  - !ruby/object:Gem::Version
222
- version: '0'
250
+ version: 2.9.1
223
251
  - !ruby/object:Gem::Dependency
224
252
  name: mysql2
225
253
  requirement: !ruby/object:Gem::Requirement
226
254
  requirements:
227
- - - ">="
255
+ - - '='
228
256
  - !ruby/object:Gem::Version
229
- version: '0'
257
+ version: 0.4.2
230
258
  type: :development
231
259
  prerelease: false
232
260
  version_requirements: !ruby/object:Gem::Requirement
233
261
  requirements:
234
- - - ">="
262
+ - - '='
235
263
  - !ruby/object:Gem::Version
236
- version: '0'
264
+ version: 0.4.2
265
+ - !ruby/object:Gem::Dependency
266
+ name: pg
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - '='
270
+ - !ruby/object:Gem::Version
271
+ version: 0.18.4
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - '='
277
+ - !ruby/object:Gem::Version
278
+ version: 0.18.4
237
279
  - !ruby/object:Gem::Dependency
238
280
  name: activerecord
239
281
  requirement: !ruby/object:Gem::Requirement
@@ -252,30 +294,30 @@ dependencies:
252
294
  name: best_practice_project
253
295
  requirement: !ruby/object:Gem::Requirement
254
296
  requirements:
255
- - - ">="
297
+ - - '='
256
298
  - !ruby/object:Gem::Version
257
- version: '0'
299
+ version: 0.0.9
258
300
  type: :development
259
301
  prerelease: false
260
302
  version_requirements: !ruby/object:Gem::Requirement
261
303
  requirements:
262
- - - ">="
304
+ - - '='
263
305
  - !ruby/object:Gem::Version
264
- version: '0'
306
+ version: 0.0.9
265
307
  - !ruby/object:Gem::Dependency
266
308
  name: rubocop
267
309
  requirement: !ruby/object:Gem::Requirement
268
310
  requirements:
269
311
  - - '='
270
312
  - !ruby/object:Gem::Version
271
- version: 0.35.1
313
+ version: 0.39.0
272
314
  type: :development
273
315
  prerelease: false
274
316
  version_requirements: !ruby/object:Gem::Requirement
275
317
  requirements:
276
318
  - - '='
277
319
  - !ruby/object:Gem::Version
278
- version: 0.35.1
320
+ version: 0.39.0
279
321
  description: A database abstraction layer, model framework and database framework.
280
322
  email: kj@gfish.com
281
323
  executables: []
@@ -286,7 +328,9 @@ extra_rdoc_files:
286
328
  files:
287
329
  - ".document"
288
330
  - ".rspec"
331
+ - ".rubocop.yml"
289
332
  - ".rubocop_todo.yml"
333
+ - ".travis.yml"
290
334
  - Gemfile
291
335
  - Gemfile.lock
292
336
  - LICENSE.txt
@@ -307,107 +351,144 @@ files:
307
351
  - lib/baza/db.rb
308
352
  - lib/baza/dbtime.rb
309
353
  - lib/baza/driver.rb
310
- - lib/baza/drivers/active_record.rb
311
- - lib/baza/drivers/active_record/columns.rb
312
- - lib/baza/drivers/active_record/indexes.rb
313
- - lib/baza/drivers/active_record/result.rb
314
- - lib/baza/drivers/active_record/tables.rb
315
- - lib/baza/drivers/mysql.rb
316
- - lib/baza/drivers/mysql/column.rb
317
- - lib/baza/drivers/mysql/columns.rb
318
- - lib/baza/drivers/mysql/database.rb
319
- - lib/baza/drivers/mysql/databases.rb
320
- - lib/baza/drivers/mysql/index.rb
321
- - lib/baza/drivers/mysql/indexes.rb
322
- - lib/baza/drivers/mysql/result.rb
323
- - lib/baza/drivers/mysql/sqlspecs.rb
324
- - lib/baza/drivers/mysql/table.rb
325
- - lib/baza/drivers/mysql/tables.rb
326
- - lib/baza/drivers/mysql/unbuffered_result.rb
327
- - lib/baza/drivers/mysql2.rb
328
- - lib/baza/drivers/mysql2/column.rb
329
- - lib/baza/drivers/mysql2/columns.rb
330
- - lib/baza/drivers/mysql2/database.rb
331
- - lib/baza/drivers/mysql2/databases.rb
332
- - lib/baza/drivers/mysql2/index.rb
333
- - lib/baza/drivers/mysql2/indexes.rb
334
- - lib/baza/drivers/mysql2/result.rb
335
- - lib/baza/drivers/mysql2/table.rb
336
- - lib/baza/drivers/mysql2/tables.rb
337
- - lib/baza/drivers/mysql_java.rb
338
- - lib/baza/drivers/mysql_java/column.rb
339
- - lib/baza/drivers/mysql_java/columns.rb
340
- - lib/baza/drivers/mysql_java/database.rb
341
- - lib/baza/drivers/mysql_java/databases.rb
342
- - lib/baza/drivers/mysql_java/index.rb
343
- - lib/baza/drivers/mysql_java/indexes.rb
344
- - lib/baza/drivers/mysql_java/table.rb
345
- - lib/baza/drivers/mysql_java/tables.rb
346
- - lib/baza/drivers/sqlite3.rb
347
- - lib/baza/drivers/sqlite3/column.rb
348
- - lib/baza/drivers/sqlite3/columns.rb
349
- - lib/baza/drivers/sqlite3/database.rb
350
- - lib/baza/drivers/sqlite3/databases.rb
351
- - lib/baza/drivers/sqlite3/index.rb
352
- - lib/baza/drivers/sqlite3/indexes.rb
353
- - lib/baza/drivers/sqlite3/result.rb
354
- - lib/baza/drivers/sqlite3/sqlspecs.rb
355
- - lib/baza/drivers/sqlite3/table.rb
356
- - lib/baza/drivers/sqlite3/tables.rb
357
- - lib/baza/drivers/sqlite3/unbuffered_result.rb
358
- - lib/baza/drivers/sqlite3_java.rb
359
- - lib/baza/drivers/sqlite3_java/column.rb
360
- - lib/baza/drivers/sqlite3_java/columns.rb
361
- - lib/baza/drivers/sqlite3_java/database.rb
362
- - lib/baza/drivers/sqlite3_java/index.rb
363
- - lib/baza/drivers/sqlite3_java/indexes.rb
364
- - lib/baza/drivers/sqlite3_java/table.rb
365
- - lib/baza/drivers/sqlite3_java/tables.rb
366
- - lib/baza/drivers/sqlite3_java/unbuffered_result.rb
367
- - lib/baza/drivers/sqlite3_rhodes.rb
354
+ - lib/baza/driver/active_record.rb
355
+ - lib/baza/driver/active_record/columns.rb
356
+ - lib/baza/driver/active_record/commands.rb
357
+ - lib/baza/driver/active_record/databases.rb
358
+ - lib/baza/driver/active_record/indexes.rb
359
+ - lib/baza/driver/active_record/result.rb
360
+ - lib/baza/driver/active_record/tables.rb
361
+ - lib/baza/driver/active_record/users.rb
362
+ - lib/baza/driver/mysql.rb
363
+ - lib/baza/driver/mysql/column.rb
364
+ - lib/baza/driver/mysql/columns.rb
365
+ - lib/baza/driver/mysql/commands.rb
366
+ - lib/baza/driver/mysql/database.rb
367
+ - lib/baza/driver/mysql/databases.rb
368
+ - lib/baza/driver/mysql/index.rb
369
+ - lib/baza/driver/mysql/indexes.rb
370
+ - lib/baza/driver/mysql/result.rb
371
+ - lib/baza/driver/mysql/sqlspecs.rb
372
+ - lib/baza/driver/mysql/table.rb
373
+ - lib/baza/driver/mysql/tables.rb
374
+ - lib/baza/driver/mysql/unbuffered_result.rb
375
+ - lib/baza/driver/mysql/user.rb
376
+ - lib/baza/driver/mysql/users.rb
377
+ - lib/baza/driver/mysql2.rb
378
+ - lib/baza/driver/mysql2/column.rb
379
+ - lib/baza/driver/mysql2/columns.rb
380
+ - lib/baza/driver/mysql2/commands.rb
381
+ - lib/baza/driver/mysql2/database.rb
382
+ - lib/baza/driver/mysql2/databases.rb
383
+ - lib/baza/driver/mysql2/index.rb
384
+ - lib/baza/driver/mysql2/indexes.rb
385
+ - lib/baza/driver/mysql2/result.rb
386
+ - lib/baza/driver/mysql2/table.rb
387
+ - lib/baza/driver/mysql2/tables.rb
388
+ - lib/baza/driver/mysql2/user.rb
389
+ - lib/baza/driver/mysql2/users.rb
390
+ - lib/baza/driver/mysql_java.rb
391
+ - lib/baza/driver/mysql_java/column.rb
392
+ - lib/baza/driver/mysql_java/columns.rb
393
+ - lib/baza/driver/mysql_java/commands.rb
394
+ - lib/baza/driver/mysql_java/database.rb
395
+ - lib/baza/driver/mysql_java/databases.rb
396
+ - lib/baza/driver/mysql_java/index.rb
397
+ - lib/baza/driver/mysql_java/indexes.rb
398
+ - lib/baza/driver/mysql_java/table.rb
399
+ - lib/baza/driver/mysql_java/tables.rb
400
+ - lib/baza/driver/mysql_java/user.rb
401
+ - lib/baza/driver/mysql_java/users.rb
402
+ - lib/baza/driver/pg.rb
403
+ - lib/baza/driver/pg/column.rb
404
+ - lib/baza/driver/pg/columns.rb
405
+ - lib/baza/driver/pg/commands.rb
406
+ - lib/baza/driver/pg/create_index_sql_creator.rb
407
+ - lib/baza/driver/pg/database.rb
408
+ - lib/baza/driver/pg/databases.rb
409
+ - lib/baza/driver/pg/index.rb
410
+ - lib/baza/driver/pg/indexes.rb
411
+ - lib/baza/driver/pg/result.rb
412
+ - lib/baza/driver/pg/table.rb
413
+ - lib/baza/driver/pg/tables.rb
414
+ - lib/baza/driver/sqlite3.rb
415
+ - lib/baza/driver/sqlite3/column.rb
416
+ - lib/baza/driver/sqlite3/columns.rb
417
+ - lib/baza/driver/sqlite3/commands.rb
418
+ - lib/baza/driver/sqlite3/database.rb
419
+ - lib/baza/driver/sqlite3/databases.rb
420
+ - lib/baza/driver/sqlite3/index.rb
421
+ - lib/baza/driver/sqlite3/indexes.rb
422
+ - lib/baza/driver/sqlite3/result.rb
423
+ - lib/baza/driver/sqlite3/sqlspecs.rb
424
+ - lib/baza/driver/sqlite3/table.rb
425
+ - lib/baza/driver/sqlite3/tables.rb
426
+ - lib/baza/driver/sqlite3/unbuffered_result.rb
427
+ - lib/baza/driver/sqlite3_java.rb
428
+ - lib/baza/driver/sqlite3_java/column.rb
429
+ - lib/baza/driver/sqlite3_java/columns.rb
430
+ - lib/baza/driver/sqlite3_java/commands.rb
431
+ - lib/baza/driver/sqlite3_java/database.rb
432
+ - lib/baza/driver/sqlite3_java/index.rb
433
+ - lib/baza/driver/sqlite3_java/indexes.rb
434
+ - lib/baza/driver/sqlite3_java/table.rb
435
+ - lib/baza/driver/sqlite3_java/tables.rb
436
+ - lib/baza/driver/sqlite3_java/unbuffered_result.rb
437
+ - lib/baza/driver/sqlite3_rhodes.rb
368
438
  - lib/baza/dump.rb
369
439
  - lib/baza/errors.rb
370
440
  - lib/baza/idquery.rb
371
441
  - lib/baza/index.rb
372
442
  - lib/baza/jdbc_driver.rb
373
443
  - lib/baza/jdbc_result.rb
374
- - lib/baza/model.rb
375
- - lib/baza/model_custom.rb
376
- - lib/baza/model_handler.rb
377
- - lib/baza/model_handler_sqlhelper.rb
378
444
  - lib/baza/mysql_base_driver.rb
379
445
  - lib/baza/query_buffer.rb
380
446
  - lib/baza/result_base.rb
381
- - lib/baza/revision.rb
382
447
  - lib/baza/row.rb
448
+ - lib/baza/sql_queries.rb
449
+ - lib/baza/sql_queries/generic_insert.rb
450
+ - lib/baza/sql_queries/generic_update.rb
451
+ - lib/baza/sql_queries/mysql_upsert.rb
452
+ - lib/baza/sql_queries/mysql_upsert_duplicate_key.rb
453
+ - lib/baza/sql_queries/non_atomic_upsert.rb
454
+ - lib/baza/sql_queries/postgres_upsert_duplicate_key.rb
455
+ - lib/baza/sql_queries/select.rb
456
+ - lib/baza/sql_queries/sqlite_upsert_duplicate_key.rb
383
457
  - lib/baza/sqlspecs.rb
384
458
  - lib/baza/table.rb
385
- - shippable.yml
386
- - spec/cloner_spec.rb
459
+ - spec/active_record/models/user.rb
460
+ - spec/baza/cloner_spec.rb
387
461
  - spec/drivers/active_record_mysql2_spec.rb
388
462
  - spec/drivers/active_record_mysql_spec.rb
463
+ - spec/drivers/active_record_pg_spec.rb
389
464
  - spec/drivers/active_record_sqlite3_spec.rb
390
465
  - spec/drivers/mysql2_spec.rb
391
466
  - spec/drivers/mysql_spec.rb
467
+ - spec/drivers/pg_spec.rb
392
468
  - spec/drivers/sqlite3_spec.rb
393
469
  - spec/info_active_record_example.rb
394
- - spec/info_active_record_mysql.rb
395
- - spec/info_active_record_mysql2.rb
396
- - spec/info_active_record_mysql2_shippable.rb
397
- - spec/info_active_record_mysql_shippable.rb
470
+ - spec/info_active_record_mysql2_example.rb
471
+ - spec/info_active_record_mysql2_travis.rb
472
+ - spec/info_active_record_mysql_example.rb
473
+ - spec/info_active_record_mysql_travis.rb
474
+ - spec/info_active_record_pg_example.rb
475
+ - spec/info_active_record_pg_travis.rb
398
476
  - spec/info_active_record_sqlite3.rb
399
477
  - spec/info_mysql2_example.rb
400
- - spec/info_mysql2_shippable.rb
478
+ - spec/info_mysql2_travis.rb
401
479
  - spec/info_mysql_example.rb
402
- - spec/info_mysql_shippable.rb
480
+ - spec/info_mysql_travis.rb
481
+ - spec/info_pg_example.rb
482
+ - spec/info_pg_travis.rb
403
483
  - spec/info_sqlite3.rb
404
- - spec/model_handler_spec.rb
405
484
  - spec/spec_helper.rb
485
+ - spec/support/driver_active_record_collection.rb
406
486
  - spec/support/driver_collection.rb
407
487
  - spec/support/driver_columns_collection.rb
408
488
  - spec/support/driver_databases_collection.rb
409
489
  - spec/support/driver_indexes_collection.rb
410
490
  - spec/support/driver_tables_collection.rb
491
+ - spec/support/driver_users_collection.rb
411
492
  homepage: http://github.com/kaspernj/baza
412
493
  licenses:
413
494
  - MIT
@@ -428,7 +509,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
428
509
  version: '0'
429
510
  requirements: []
430
511
  rubyforge_project:
431
- rubygems_version: 2.4.0
512
+ rubygems_version: 2.2.2
432
513
  signing_key:
433
514
  specification_version: 4
434
515
  summary: A database abstraction layer, model framework and database framework.