sequel-xtdb 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 588ca986b6f08698e828e9b82ca407efe7ed9cb53bcf88e4bb7d5a3079c543bb
4
+ data.tar.gz: 6f40888887ed889acf0bb4fe0b71aae53e566453668dcea3c983fc5fddfdb11c
5
+ SHA512:
6
+ metadata.gz: de181ba238344b2eb73143653a63ecd67d53a1920f5016f88b505ec4bc0ad9c8f8461e7bc15dc66f19ac53fe01e840db470a8e7128e48fd33d491b93e73210d2
7
+ data.tar.gz: a4dab5cb1ca1ee2e760580df3d12efa101e176dcf0bf5c03f0fc7bab6bedef08f557a6175eaffc5080e0c8b7c6b75e01b78d406aef6c9b9bc65c7095f6cb1b65
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.standard.yml ADDED
@@ -0,0 +1,3 @@
1
+ # For available configuration options, see:
2
+ # https://github.com/standardrb/standard
3
+ ruby_version: 3.0
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2024-12-13
4
+
5
+ - Initial release
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Gert Goet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # Sequel::XTDB
2
+
3
+ Adapter to connect to XTDB v2 using Sequel.
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ ```bash
10
+ bundle add sequel-xtdb
11
+ ```
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ ```bash
16
+ gem install sequel-xtdb
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ Shortcut to happiness:
22
+ ```ruby
23
+ # Get a Ruby console using the sequel CLI
24
+ $ sequel 'xtdb://localhost:5432/xtdb'
25
+
26
+ # ..or from repl/your project
27
+ DB = Sequel.connect("xtdb://localhost:54321/xtdb")
28
+
29
+ # then
30
+ irb(main)> DB << "insert into products(_id, name, price) values(1, 'Spam', 1000), (2, 'Ham', 1200)"
31
+ irb(main)> DB["select * from products"].all
32
+ => [{:_id=>2, :name=>"Ham", :price=>1200}, {:_id=>1, :name=>"Spam", :price=>1100}]
33
+ ```
34
+
35
+ ## Status
36
+
37
+ Very early days :)
38
+ Currently it's essentially the postgres-adapter with support for a xtdb-scheme url.
39
+
40
+
41
+ ## Development
42
+
43
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
44
+
45
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
46
+
47
+ ## Contributing
48
+
49
+ Bug reports and pull requests are welcome on GitHub at https://github.com/eval/sequel-xtdb.
50
+
51
+ ## License
52
+
53
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "standard/rake"
9
+
10
+ task default: %i[spec standard]
@@ -0,0 +1,9 @@
1
+ module Sequel
2
+ module XTDB
3
+ module DatabaseMethods
4
+ end
5
+
6
+ module DatasetMethods
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,24 @@
1
+ require_relative 'shared/xtdb'
2
+ require "sequel/adapters/postgres"
3
+
4
+ module Sequel
5
+ module XTDB
6
+ class Database < Sequel::Postgres::Database
7
+ include ::Sequel::XTDB::DatabaseMethods
8
+
9
+ set_adapter_scheme :xtdb
10
+
11
+ private
12
+
13
+ def adapter_initialize
14
+ # XTDB can't handle this SET-command
15
+ @opts[:force_standard_strings] = false
16
+ super
17
+ end
18
+ end
19
+
20
+ class Dataset < Sequel::Postgres::Dataset
21
+ include ::Sequel::XTDB::DatasetMethods
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sequel
4
+ module XTDB
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "xtdb/version"
4
+ require "sequel"
5
+
6
+ module Sequel
7
+ module XTDB
8
+ class Error < StandardError; end
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ module Sequel
2
+ module XTDB
3
+ VERSION: String
4
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sequel-xtdb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Gert Goet
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-12-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sequel
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pg
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Unlock the power of bi-temporality.
42
+ email:
43
+ - gert@thinkcreate.dk
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".rspec"
49
+ - ".standard.yml"
50
+ - CHANGELOG.md
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - lib/sequel/adapters/shared/xtdb.rb
55
+ - lib/sequel/adapters/xtdb.rb
56
+ - lib/sequel/xtdb.rb
57
+ - lib/sequel/xtdb/version.rb
58
+ - sig/sequel/xtdb.rbs
59
+ homepage: https://github.com/eval/sequel-xtdb
60
+ licenses:
61
+ - MIT
62
+ metadata:
63
+ homepage_uri: https://github.com/eval/sequel-xtdb
64
+ source_code_uri: https://github.com/eval/sequel-xtdb
65
+ changelog_uri: https://github.com/eval/sequel-xtdb/blob/main/CHANGELOG.md
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 3.0.0
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubygems_version: 3.5.23
82
+ signing_key:
83
+ specification_version: 4
84
+ summary: Adapter to connect to XTDB v2 using Sequel.
85
+ test_files: []