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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '035816431be310fe0576e3484d8567531a899ac9b5bde00ef6eae5f40d835c10'
4
- data.tar.gz: 26e1ab9017bb812343fc61e98d2d23c1f197e4b7a5bcea97b2809a61df61bd6d
3
+ metadata.gz: 86a404e12eedc21b57a6de7b9bdbd5233ec8e026f4983425482a6282850b208c
4
+ data.tar.gz: cfac0f1fd6b91606ddb9cf50c8bf4fc2a5cdf70ec7227f360b8f447e8cd8ba0f
5
5
  SHA512:
6
- metadata.gz: 6d858c2bd63c590f05b12df2ee6f5fba4551c77fd668143a42d548a1d52ec6d5725fa4d94e9df235266d73996f8b31d5a4cd4bb1451cd59c1544e38825337ac6
7
- data.tar.gz: 9becfe75e0c743be9c765904eaabf2f52b757d6532db7a04a7381414c4532496233c7dcf398ca23d681494b4f61258dc6db5653b6459b88f617582d0abe47e47
6
+ metadata.gz: cebdcc060495de35cc9940d092cc613f598b3d512339b2589e8abdf45ab62c9e38f43c166ddeac76061ec44756dbe33b031db212c264cda2cade1e7eb9d70c28
7
+ data.tar.gz: 9df850b4e73f27df943c6154f21c9a870fe8c26bb88a4569ff66449e0cdb3e16f71f6e094c39463dbd0ce1ab86ecf92d6563d9ce771f6292b7c4664ac61aed27
@@ -24,8 +24,6 @@ require_relative 'connection'
24
24
 
25
25
  module DB
26
26
  module MariaDB
27
- LOCAL = "mysql://localhost/test"
28
-
29
27
  class Adapter
30
28
  def initialize(**options)
31
29
  @options = options
@@ -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', user: nil, password: nil, database: nil, port: 0, unix_socket: nil, client_flags: 0, compression: false, types: DEFAULT_TYPES, **options)
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, user, password, database, port, unix_socket, client_flags);
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
 
@@ -20,6 +20,6 @@
20
20
 
21
21
  module DB
22
22
  module MariaDB
23
- VERSION = "0.5.0"
23
+ VERSION = "0.6.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.5.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: 2020-07-06 00:00:00.000000000 Z
11
+ date: 2021-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi