activerecord-cubrid2-adapter 0.0.1
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 +7 -0
- data/.gitignore +19 -0
- data/LICENSE +21 -0
- data/README.md +63 -0
- data/Rakefile +11 -0
- data/VERSION +1 -0
- data/activerecord-cubrid2-adapter.gemspec +26 -0
- data/lib/active_record/connection_adapters/abstract_cubrid2_adapter.rb +750 -0
- data/lib/active_record/connection_adapters/cubrid2/column.rb +28 -0
- data/lib/active_record/connection_adapters/cubrid2/database_statements.rb +192 -0
- data/lib/active_record/connection_adapters/cubrid2/explain_pretty_printer.rb +71 -0
- data/lib/active_record/connection_adapters/cubrid2/quoting.rb +118 -0
- data/lib/active_record/connection_adapters/cubrid2/schema_creation.rb +98 -0
- data/lib/active_record/connection_adapters/cubrid2/schema_definitions.rb +81 -0
- data/lib/active_record/connection_adapters/cubrid2/schema_dumper.rb +31 -0
- data/lib/active_record/connection_adapters/cubrid2/schema_statements.rb +276 -0
- data/lib/active_record/connection_adapters/cubrid2/type_metadata.rb +31 -0
- data/lib/active_record/connection_adapters/cubrid2/version.rb +7 -0
- data/lib/active_record/connection_adapters/cubrid2_adapter.rb +169 -0
- data/lib/activerecord-cubrid2-adapter.rb +4 -0
- data/lib/arel/visitors/cubrid.rb +67 -0
- data/lib/cubrid2/client.rb +93 -0
- data/lib/cubrid2/console.rb +5 -0
- data/lib/cubrid2/error.rb +86 -0
- data/lib/cubrid2/field.rb +3 -0
- data/lib/cubrid2/result.rb +7 -0
- data/lib/cubrid2/statement.rb +11 -0
- data/lib/cubrid2/version.rb +3 -0
- data/lib/cubrid2.rb +76 -0
- data/tests/Gemfile +10 -0
- data/tests/test_activerecord.rb +109 -0
- metadata +102 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c06a871f89134bc5f13e2905a30968756ade6e68f72d7c227e5b186e65d05cd3
|
4
|
+
data.tar.gz: c20757cde7ba8620d30f8a6f5803695a1492f1690470a6bc0f0c13b21a8af375
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e47475a4c8728ac72673f88abc60ab53179d6397d97930bf475f0b1005e0fe956ebed46ad5c16a16800bb4689d99626e074ba2136e4bff9e88c5a517f3f79da2
|
7
|
+
data.tar.gz: 92bb1744b6427c10c923db59486e26c1687df128a63af79d842add0a3eb94d478d4db3fa0de6f73603aa25af074e3d517e1200d5d42af4b0696bed5e5c386759
|
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2022 Eui-Taik Na
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# activerecord-cubrid2-adapter
|
2
|
+
Cubrid database connector for ruby, and active_record, depends on 'cubrid' gem
|
3
|
+
|
4
|
+
DESCRIPTION
|
5
|
+
-----------
|
6
|
+
|
7
|
+
Cubrid2 ActiveRecord adapter privides Cubrid database from Ruby on Rails applications. Now works with Ruby on Rails 6.0 and it is working with Cubrid database versions 9.x to higher.
|
8
|
+
|
9
|
+
BUILD
|
10
|
+
------------
|
11
|
+
```ruby
|
12
|
+
gem install rake-compiler
|
13
|
+
rake build
|
14
|
+
```
|
15
|
+
|
16
|
+
INSTALLATION
|
17
|
+
------------
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
# Use cubrid as the database for Active Record
|
21
|
+
gem 'cubrid' # cubrid interface gem, based on native CCI C interface
|
22
|
+
gem 'activerecord-cubrid2-adapter'
|
23
|
+
```
|
24
|
+
Currently Rails <6.0, >=7.0, Windows, JRuby is not tested.
|
25
|
+
|
26
|
+
### Without Rails and Bundler
|
27
|
+
|
28
|
+
If you want to use ActiveRecord and Cubrid2 adapter without Rails and Bundler then install it just as a gem:
|
29
|
+
|
30
|
+
```bash
|
31
|
+
gem install activerecord-cubrid2-adapter
|
32
|
+
```
|
33
|
+
|
34
|
+
USAGE
|
35
|
+
-----
|
36
|
+
|
37
|
+
### Database connection
|
38
|
+
|
39
|
+
In Rails application `config/database.yml` use 'cubrid2' as adapter name, e.g.
|
40
|
+
|
41
|
+
```yml
|
42
|
+
development:
|
43
|
+
adapter: cubrid2
|
44
|
+
host: localhost
|
45
|
+
database: testdb
|
46
|
+
username: user
|
47
|
+
password: secret
|
48
|
+
```
|
49
|
+
|
50
|
+
EXAMPLE
|
51
|
+
-------------
|
52
|
+
|
53
|
+
Check test_activerecord.rb in the tests directory.
|
54
|
+
|
55
|
+
|
56
|
+
LINKS
|
57
|
+
-----
|
58
|
+
|
59
|
+
* Source code: https://github.com/damulhan/activerecord-cubrid2-adapter
|
60
|
+
* Active Record – Object-relational mapping in Rails: https://github.com/rails/rails/tree/main/activerecord
|
61
|
+
* Cubrid Ruby GEM: https://github.com/CUBRID/cubrid-ruby
|
62
|
+
* Cubrid Homepage: https://www.cubrid.org
|
63
|
+
|
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
version = File.read(File.expand_path('VERSION', __dir__)).strip
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'activerecord-cubrid2-adapter'
|
7
|
+
spec.platform = Gem::Platform::RUBY
|
8
|
+
spec.version = version
|
9
|
+
|
10
|
+
spec.required_ruby_version = '>= 2.5.0'
|
11
|
+
|
12
|
+
spec.licenses = ['MIT', 'GPL-2.0']
|
13
|
+
spec.authors = ['Eui-Taik Na']
|
14
|
+
spec.email = ['damulhan@gmail.com']
|
15
|
+
spec.homepage = 'https://github.com/damulhan/activerecord-cubrid2-adapter'
|
16
|
+
spec.summary = 'ActiveRecord Cubrid Adapter.'
|
17
|
+
spec.description = 'ActiveRecord Cubrid Adapter. Cubrid 9 and upward. Based on cubrid gem.'
|
18
|
+
|
19
|
+
spec.files = `git ls-files -z`.split("\x0")
|
20
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
22
|
+
spec.require_paths = ['lib']
|
23
|
+
|
24
|
+
spec.add_dependency 'activerecord', '~> 6.0'
|
25
|
+
spec.add_dependency 'cubrid', '>= 10.0'
|
26
|
+
end
|