db-mariadb 0.2.2 → 0.4.0

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
  SHA256:
3
- metadata.gz: 5f27b7da8ad5cdec94cfd6b7ae6f078b30886231c62f49489892e2d41c1c9d96
4
- data.tar.gz: a194fe786b2ce7fe4a22c276e5b38a47d52a965321747604e7a502f62bcaa5f9
3
+ metadata.gz: 5a5fec76a4d531cdcad6ea1d54e10b6a251895a47207d74acec924a02edc3da5
4
+ data.tar.gz: a9890c37d02dc2e0493eee2d7af4f89f05de994464c99435eb10ff43bea13ef7
5
5
  SHA512:
6
- metadata.gz: 9ec2fb9d0d2c6d2fa0c5720297ea55a18a68da966bf7f0216bdf103260764b54ab8f88b5f3b301820c833348969eb14a37a93873fe3ba68c5106579006c79919
7
- data.tar.gz: ac9e5b54a6013203dba3fef1fa70ff2f0969753ff73c397948ccad2f41c4cad114a278068b5e0a8fc5eda7a2e75713d30a83cc7ee602dde78e4faf2efb6c0eb8
6
+ metadata.gz: 1f5aa5144c1194868398e71eaab0dd42361d2c2b8674e41d0f1dda22f2c2f73367f2eda61eca900e8bca5deb5b5a810848db6816a2343217bf0b45be720557a8
7
+ data.tar.gz: a7a18fa736f1766dbbc0b38b01b71c15c6b844a5b8212063f85c6517db942588c63b92b036e9b229326cf55d2c99cde5c179592496149a05d3210824a0d5d9e3
@@ -24,4 +24,4 @@ require_relative 'mariadb/connection'
24
24
  require_relative 'mariadb/adapter'
25
25
 
26
26
  require 'db/adapters'
27
- DB::Adapters.register(:mysql, DB::MariaDB::Adapter)
27
+ DB::Adapters.register(:mariadb, DB::MariaDB::Adapter)
@@ -21,16 +21,12 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  require 'async/pool/resource'
24
+ require 'async/io/generic'
25
+
24
26
  require_relative 'native/connection'
25
27
 
26
28
  module DB
27
29
  module MariaDB
28
- module IO
29
- def self.new(fd, mode)
30
- Async::IO::Generic.new(::IO.new(fd, mode, autoclose: false))
31
- end
32
- end
33
-
34
30
  # This implements the interface between the underyling native interface interface and "standardised" connection interface.
35
31
  class Connection < Async::Pool::Resource
36
32
  def initialize(**options)
@@ -19,7 +19,7 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  require_relative 'result'
22
- require 'async/io/generic'
22
+ require_relative '../error'
23
23
 
24
24
  module DB
25
25
  module MariaDB
@@ -63,8 +63,14 @@ module DB
63
63
 
64
64
  attach_function :mysql_real_escape_string, [:pointer, :pointer, :string, :size_t], :size_t
65
65
 
66
+ module IO
67
+ def self.new(fd, mode)
68
+ Async::IO::Generic.new(::IO.new(fd, mode, autoclose: false))
69
+ end
70
+ end
71
+
66
72
  class Connection < FFI::Pointer
67
- def self.connect(io: IO, host: 'localhost', user: nil, password: nil, database: nil, port: 0, unix_socket: nil, client_flags: 0, compression: false, types: DEFAULT_TYPES, **options)
73
+ def self.connect(wrapper: IO, host: 'localhost', user: nil, password: nil, database: nil, port: 0, unix_socket: nil, client_flags: 0, compression: false, types: DEFAULT_TYPES, **options)
68
74
  pointer = Native.mysql_init(nil)
69
75
  Native.mysql_options(pointer, MYSQL_OPT_NONBLOCK, nil)
70
76
 
@@ -79,7 +85,7 @@ module DB
79
85
  status = Native.mysql_real_connect_start(result, pointer, host, user, password, database, port, unix_socket, client_flags);
80
86
 
81
87
  if status > 0
82
- io = IO.new(Native.mysql_get_socket(pointer), "r+")
88
+ io = wrapper.new(Native.mysql_get_socket(pointer), "r+")
83
89
 
84
90
  while status > 0
85
91
  if status & MYSQL_WAIT_READ
@@ -101,7 +107,7 @@ module DB
101
107
  return self.new(pointer, io, types, **options)
102
108
  end
103
109
 
104
- def initialize(address, io, types)
110
+ def initialize(address, io, types, **options)
105
111
  super(address)
106
112
 
107
113
  @io = io
@@ -20,6 +20,6 @@
20
20
 
21
21
  module DB
22
22
  module MariaDB
23
- VERSION = "0.2.2"
23
+ VERSION = "0.4.0"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db-mariadb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-05 00:00:00.000000000 Z
11
+ date: 2020-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi