swift-db-postgres 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc766e16cbc7b9e12a4d7d2b4279ab7367abd1fb
4
- data.tar.gz: 93df7185b55a780878477a44188c103ff4be7a83
3
+ metadata.gz: 3acbb4ef1814220888f0e38e28e0c6298a955e7b
4
+ data.tar.gz: 370402b770e4b496972af96c351e328cc6f6c7c8
5
5
  SHA512:
6
- metadata.gz: 04e72c8d3cd07ba18bcd643566819e2fcf44e63aded792b365a48f607c69243d534dd3292b27ed4985013a653433aa264ee2124e4a5311e0d7ca4819f9fe5214
7
- data.tar.gz: 596140d12a9a7b8de1ba2361cee3ef1c660926a640ca89d6010810fa0d16bab18f004012077c194e721098a72ee84a288bac56b7b9848b7b8b56c02f36f56f30
6
+ metadata.gz: fbb8947e066dd36a0131f6f21f71a6801db3a1c23b7b53201478a95785c21b4ac66fe8a22e0006a6df6391fe9965de380249db935ba50f07504e8b8a8801e3c0
7
+ data.tar.gz: bb8d61ae2051accc041c378c52ea9405ed88fa2125854be3258ca33b2e58223a9e079aeab7d78100e3d8e82918629a827d802f930026af329bea4bd95372081a
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.3.2 (2018-06-15)
2
+
3
+ * updated extconf.rb to use pg_config if present.
4
+
1
5
  == 0.3.1 (2015-03-22)
2
6
 
3
7
  * prepared statement uuid overflow fix.
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Swift PostgreSQL adapter
2
2
 
3
- MRI adapter for PostgreSQL
3
+ PostgreSQL adapter for MRI Ruby.
4
+
5
+ NOTE: This has nothing to do with Swift programming language (OSX, iOS)
4
6
 
5
7
  ## Features
6
8
 
@@ -159,26 +161,27 @@ db.read(csv)
159
161
 
160
162
  ## Performance
161
163
 
162
- Don't read too much into it. Each library has its advantages and disadvantages.
164
+ Tests:
165
+ * Insert 1000 rows
166
+ * Read them back 100 times with typecast enabled
163
167
 
164
- * insert 1000 rows and read them back 100 times with typecast enabled
165
- * pg uses the pg_typecast extension
168
+ Caveats:
169
+ * This is just a raw performance benchmark, each library has its advantages and disadvantages.
166
170
 
167
171
  ```
168
172
  $ ruby -v
169
-
170
- ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
173
+ ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
171
174
 
172
175
  $ ruby check.rb
173
- user system total real
174
- do_postgres insert 0.190000 0.080000 0.270000 ( 0.587877)
175
- do_postgres select 1.440000 0.020000 1.460000 ( 2.081172)
176
+ user system total real
177
+ swift insert 0.020000 0.000000 0.020000 ( 0.090353)
178
+ swift select 0.170000 0.000000 0.170000 ( 0.268109)
176
179
 
177
- pg insert 0.100000 0.030000 0.130000 ( 0.395280)
178
- pg select 0.630000 0.220000 0.850000 ( 1.284905)
180
+ do_postgres insert 0.020000 0.020000 0.040000 ( 0.096619)
181
+ do_postgres select 0.550000 0.000000 0.550000 ( 0.659646)
179
182
 
180
- swift insert 0.070000 0.040000 0.110000 ( 0.348211)
181
- swift select 0.640000 0.030000 0.670000 ( 1.111561)
183
+ pg insert 0.020000 0.000000 0.020000 ( 0.069376)
184
+ pg select 0.680000 0.030000 0.710000 ( 0.819120)
182
185
  ```
183
186
 
184
187
  ## License
@@ -22,6 +22,10 @@ lib_paths = %w(
22
22
  /sw/lib
23
23
  )
24
24
 
25
+ # add paths for pg_config
26
+ inc_paths.unshift(%x{pg_config --includedir}.strip) rescue nil
27
+ lib_paths.unshift(%x{pg_config --libdir}.strip) rescue nil
28
+
25
29
  uuid_inc, uuid_lib = dir_config('uuid', '/usr/include/uuid', '/usr/lib')
26
30
  libpq_inc, libpq_lib = dir_config('postgresql')
27
31
 
@@ -37,7 +37,7 @@ describe 'postgres adapter' do
37
37
  row = result.first
38
38
  assert_equal 1, row[:id]
39
39
  assert_equal 'test', row[:name]
40
- assert_equal nil, row[:age]
40
+ assert_nil row[:age]
41
41
  assert_equal now.to_f.round(3), row[:created_at].to_time.to_f.round(3) # millisecs resolution on postgres
42
42
 
43
43
  result = db.execute('delete from users where id = 0')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swift-db-postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bharanee Rathna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-22 00:00:00.000000000 Z
11
+ date: 2018-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -76,9 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.2.0
79
+ rubygems_version: 2.6.13
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Swift postgres adapter
83
83
  test_files: []
84
- has_rdoc: