db-mariadb 0.5.0 → 0.6.0
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/db/mariadb/adapter.rb +0 -2
- data/lib/db/mariadb/native/connection.rb +9 -2
- data/lib/db/mariadb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86a404e12eedc21b57a6de7b9bdbd5233ec8e026f4983425482a6282850b208c
|
4
|
+
data.tar.gz: cfac0f1fd6b91606ddb9cf50c8bf4fc2a5cdf70ec7227f360b8f447e8cd8ba0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cebdcc060495de35cc9940d092cc613f598b3d512339b2589e8abdf45ab62c9e38f43c166ddeac76061ec44756dbe33b031db212c264cda2cade1e7eb9d70c28
|
7
|
+
data.tar.gz: 9df850b4e73f27df943c6154f21c9a870fe8c26bb88a4569ff66449e0cdb3e16f71f6e094c39463dbd0ce1ab86ecf92d6563d9ce771f6292b7c4664ac61aed27
|
data/lib/db/mariadb/adapter.rb
CHANGED
@@ -24,6 +24,9 @@ require_relative '../error'
|
|
24
24
|
module DB
|
25
25
|
module MariaDB
|
26
26
|
module Native
|
27
|
+
MYSQL_PROTOCOL_TCP = 1
|
28
|
+
|
29
|
+
MYSQL_OPT_PROTOCOL = 9
|
27
30
|
MYSQL_OPT_NONBLOCK = 6000
|
28
31
|
|
29
32
|
MYSQL_WAIT_READ = 1
|
@@ -70,10 +73,14 @@ module DB
|
|
70
73
|
end
|
71
74
|
|
72
75
|
class Connection < FFI::Pointer
|
73
|
-
def self.connect(wrapper: IO, host: 'localhost',
|
76
|
+
def self.connect(wrapper: IO, host: 'localhost', username: nil, password: nil, database: nil, port: 0, unix_socket: nil, client_flags: 0, compression: false, types: DEFAULT_TYPES, **options)
|
74
77
|
pointer = Native.mysql_init(nil)
|
75
78
|
Native.mysql_options(pointer, MYSQL_OPT_NONBLOCK, nil)
|
76
79
|
|
80
|
+
# if protocol
|
81
|
+
# Native.mysql_options(pointer, MYSQL_OPT_PROTOCOL, FFI::MemoryPointer.new(:uint, protocol))
|
82
|
+
# end
|
83
|
+
|
77
84
|
client_flags |= CLIENT_MULTI_STATEMENT | CLIENT_MULTI_RESULTS
|
78
85
|
|
79
86
|
if compression
|
@@ -82,7 +89,7 @@ module DB
|
|
82
89
|
|
83
90
|
result = FFI::MemoryPointer.new(:pointer)
|
84
91
|
|
85
|
-
status = Native.mysql_real_connect_start(result, pointer, host,
|
92
|
+
status = Native.mysql_real_connect_start(result, pointer, host, username, password, database, port, unix_socket, client_flags);
|
86
93
|
|
87
94
|
io = wrapper.new(Native.mysql_get_socket(pointer), "r+")
|
88
95
|
|
data/lib/db/mariadb/version.rb
CHANGED
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.
|
4
|
+
version: 0.6.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:
|
11
|
+
date: 2021-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|