swift-db-sqlite3 0.1.3 → 0.1.5

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3fb143d750dca51d468f31ecf400d9e7f953522c
4
+ data.tar.gz: 02e830cf6765e54ddfbba5d4371dc89a819d3bb5
5
+ SHA512:
6
+ metadata.gz: 0066e8eb9eb9302ce90efa12763114d4723deba33e8b8fd5bccfe608d15b8ade2cc84925b7d2cc74928787c3c1a3e1a5eea38e735877226953994c54562e70db
7
+ data.tar.gz: 35081a619d2469246385ec323270bb251c30ef4b43bc8fd461c3da4da010d08daaf6cb6f2dad619a2aca3f99af16e0e304013d4fdbddd2cf4e6132fa45e3ef29
data/CHANGELOG CHANGED
@@ -1,3 +1,11 @@
1
+ == 0.1.5 (2015-03-22)
2
+
3
+ * prepared statement uuid overflow fix.
4
+
5
+ == 0.1.4 (2012-12-29)
6
+
7
+ * namespace symbols.
8
+
1
9
  == 0.1.3 (2012-09-09)
2
10
 
3
11
  * ensure sql is stringified before sqlite3_prepare_v2
data/README.md CHANGED
@@ -9,6 +9,18 @@ MRI adapter for sqlite3 for use in Swift ORM.
9
9
  * Prepared statements
10
10
  * Nested transactions
11
11
 
12
+ ## Requirements
13
+
14
+ * sqlite3 development libs (libsqlite3-dev)
15
+ * uuid development libs (uuid-dev)
16
+
17
+ ## Building
18
+
19
+ ```
20
+ git submodule update --init
21
+ rake
22
+ ```
23
+
12
24
  ## API
13
25
 
14
26
  ```
@@ -220,7 +220,7 @@ VALUE db_sqlite3_adapter_escape(VALUE self, VALUE text) {
220
220
  }
221
221
 
222
222
  void init_swift_db_sqlite3_adapter() {
223
- cDSA = rb_define_class_under(mDB, "Sqlite3", rb_cObject);
223
+ cDSA = rb_define_class_under(mSwiftDB, "Sqlite3", rb_cObject);
224
224
  rb_define_alloc_func(cDSA, db_sqlite3_adapter_allocate);
225
225
 
226
226
  rb_define_method(cDSA, "initialize", db_sqlite3_adapter_initialize, 1);
@@ -11,9 +11,10 @@ VALUE rb_uuid_string() {
11
11
  char uuid_hex[sizeof(uuid_t) * 2 + 1];
12
12
 
13
13
  uuid_generate(uuid);
14
+
15
+ memset(uuid_hex, 0, sizeof(uuid_hex));
14
16
  for (n = 0; n < sizeof(uuid_t); n++)
15
- sprintf(uuid_hex + n * 2 + 1, "%02x", uuid[n]);
17
+ sprintf(uuid_hex + n * 2, "%02x", uuid[n]);
16
18
 
17
- uuid_hex[0] = 'u';
18
- return rb_str_new(uuid_hex, sizeof(uuid_t) * 2 + 1);
19
+ return rb_str_new(uuid_hex, sizeof(uuid_t) * 2);
19
20
  }
@@ -15,7 +15,7 @@
15
15
  #include <time.h>
16
16
  #include <unistd.h>
17
17
 
18
- extern VALUE mSwift, mDB;
18
+ extern VALUE mSwift, mSwiftDB;
19
19
  extern VALUE cDSA, cDSS, cDSR;
20
20
  extern VALUE eSwiftError, eSwiftArgumentError, eSwiftRuntimeError, eSwiftConnectionError;
21
21
 
@@ -1,6 +1,11 @@
1
1
  #include "datetime.h"
2
+ #include <time.h>
2
3
  #include <ctype.h>
3
4
 
5
+ #define CONST_GET(scope, constant) rb_funcall(scope, rb_intern("const_get"), 1, rb_str_new2(constant))
6
+ #define TO_S(v) rb_funcall(v, rb_intern("to_s"), 0)
7
+ #define CSTRING(v) RSTRING_PTR(TO_S(v))
8
+
4
9
  extern VALUE dtformat;
5
10
 
6
11
  VALUE cSwiftDateTime, day_seconds;
@@ -1,8 +1,11 @@
1
1
  #pragma once
2
2
 
3
- #include "common.h"
4
- #include <math.h>
3
+ #include <ruby.h>
4
+ #include <stdlib.h>
5
+ #include <stdint.h>
6
+ #include <string.h>
7
+ #include <stdbool.h>
5
8
 
6
- DLL_PRIVATE extern VALUE cSwiftDateTime;
7
- DLL_PRIVATE void init_swift_datetime();
8
- DLL_PRIVATE VALUE datetime_parse(VALUE klass, const char *data, size_t size);
9
+ extern VALUE cSwiftDateTime;
10
+ void init_swift_datetime();
11
+ VALUE datetime_parse(VALUE klass, const char *data, size_t size);
@@ -8,12 +8,12 @@
8
8
  #include "result.h"
9
9
  #include "datetime.h"
10
10
 
11
- VALUE mSwift, mDB;
11
+ VALUE mSwift, mSwiftDB;
12
12
  VALUE eSwiftError, eSwiftArgumentError, eSwiftRuntimeError, eSwiftConnectionError;
13
13
 
14
14
  void Init_swift_db_sqlite3_ext() {
15
- mSwift = rb_define_module("Swift");
16
- mDB = rb_define_module_under(mSwift, "DB");
15
+ mSwift = rb_define_module("Swift");
16
+ mSwiftDB = rb_define_module_under(mSwift, "DB");
17
17
 
18
18
  eSwiftError = rb_define_class_under(mSwift, "Error", rb_eStandardError);
19
19
  eSwiftArgumentError = rb_define_class_under(mSwift, "ArgumentError", eSwiftError);
@@ -1,3 +1,4 @@
1
+ require 'bundler/setup'
1
2
  require 'minitest/autorun'
2
3
  require 'swift/db/sqlite3'
3
4
 
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swift-db-sqlite3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
5
- prerelease:
4
+ version: 0.1.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Bharanee Rathna
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-09-09 00:00:00.000000000 Z
11
+ date: 2015-03-22 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  description: Swift adapter for Sqlite3 database
@@ -35,51 +32,50 @@ extensions:
35
32
  - ext/swift/db/sqlite3/extconf.rb
36
33
  extra_rdoc_files: []
37
34
  files:
38
- - ext/swift/db/sqlite3/statement.c
35
+ - CHANGELOG
36
+ - README.md
39
37
  - ext/swift/db/sqlite3/adapter.c
40
- - ext/swift/db/sqlite3/datetime.c
41
- - ext/swift/db/sqlite3/typecast.c
42
- - ext/swift/db/sqlite3/result.c
43
- - ext/swift/db/sqlite3/common.c
44
- - ext/swift/db/sqlite3/main.c
45
38
  - ext/swift/db/sqlite3/adapter.h
46
- - ext/swift/db/sqlite3/statement.h
47
- - ext/swift/db/sqlite3/typecast.h
39
+ - ext/swift/db/sqlite3/common.c
48
40
  - ext/swift/db/sqlite3/common.h
49
- - ext/swift/db/sqlite3/result.h
41
+ - ext/swift/db/sqlite3/datetime.c
50
42
  - ext/swift/db/sqlite3/datetime.h
51
43
  - ext/swift/db/sqlite3/extconf.rb
52
- - test/test_encoding.rb
44
+ - ext/swift/db/sqlite3/main.c
45
+ - ext/swift/db/sqlite3/result.c
46
+ - ext/swift/db/sqlite3/result.h
47
+ - ext/swift/db/sqlite3/statement.c
48
+ - ext/swift/db/sqlite3/statement.h
49
+ - ext/swift/db/sqlite3/typecast.c
50
+ - ext/swift/db/sqlite3/typecast.h
51
+ - lib/swift-db-sqlite3.rb
52
+ - lib/swift/db/sqlite3.rb
53
53
  - test/helper.rb
54
54
  - test/test_adapter.rb
55
- - lib/swift/db/sqlite3.rb
56
- - lib/swift-db-sqlite3.rb
57
- - README.md
58
- - CHANGELOG
55
+ - test/test_encoding.rb
59
56
  homepage: http://github.com/deepfryed/swift-db-sqlite3
60
57
  licenses: []
58
+ metadata: {}
61
59
  post_install_message:
62
60
  rdoc_options: []
63
61
  require_paths:
64
62
  - lib
65
63
  - ext
66
64
  required_ruby_version: !ruby/object:Gem::Requirement
67
- none: false
68
65
  requirements:
69
- - - ! '>='
66
+ - - ">="
70
67
  - !ruby/object:Gem::Version
71
68
  version: '0'
72
69
  required_rubygems_version: !ruby/object:Gem::Requirement
73
- none: false
74
70
  requirements:
75
- - - ! '>='
71
+ - - ">="
76
72
  - !ruby/object:Gem::Version
77
73
  version: '0'
78
74
  requirements: []
79
75
  rubyforge_project:
80
- rubygems_version: 1.8.24
76
+ rubygems_version: 2.2.0
81
77
  signing_key:
82
- specification_version: 3
78
+ specification_version: 4
83
79
  summary: Swift sqlite3 adapter
84
80
  test_files: []
85
81
  has_rdoc: