sqlean 0.2.0-x86_64-linux-musl

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: 3962959c4eb4ada8f72eb8abf540d71d258f903acdc21994ca65bb7c8cfe3e42
4
+ data.tar.gz: b5dfea476786d3216763f6862a6f322473c94896e878ff7e43098a654998b493
5
+ SHA512:
6
+ metadata.gz: be2e1356c9d6f46741fffd633349bdedbc42430ab08db54a99234082347a923ec1f1fce18d4b130b1009ddb044e02c31d43f708e2474d54e1c07aff1650e61b6
7
+ data.tar.gz: a7439a9bc69cf42a9f8725d575183fb4fe01d45f111f62419d16060dc69c6512adafd5a28d62b21ba259449de9431ce6431e2153b727abbf5d678e05814de7f6
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # SQLean for Ruby Changelog
2
+
3
+ ## v0.2.0 / 2024-11-24
4
+
5
+ - Support for x86_64-linux-musl with self-built extensions.
6
+ - Explicitly state no-support for aarch64-linux-musl.
7
+
8
+
9
+ ## v0.1.0 / 2024-11-24
10
+
11
+ - Initial experimental release
@@ -0,0 +1,25 @@
1
+ The SQLean ruby gem ships with a third party dependency, SQLean, whose license is included below.
2
+
3
+ The original license can be found at https://github.com/nalgeon/sqlean/blob/main/LICENSE
4
+
5
+ MIT License
6
+
7
+ Copyright (c) 2021+ Anton Zhiyanov <https://github.com/nalgeon/sqlean>
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Mike Dalessio
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,132 @@
1
+ # SQLean Ruby
2
+
3
+ Precompiled [SQLean](https://github.com/nalgeon/sqlean) extensions for SQLite, packaged for the Ruby ecosystem. Compatible with SQLite3, Extralite, and any other sqlite-based library that exposes [`sqlite3_load_extension`](https://www.sqlite.org/c3ref/load_extension.html).
4
+
5
+
6
+ ## Usage
7
+
8
+ Please read the upstream documentation at https://antonz.org/sqlean/ or https://github.com/nalgeon/sqlean for details on what is provided by the SQLean extensions.
9
+
10
+ The available extensions are:
11
+
12
+ - [SQLean::Crypto](https://github.com/nalgeon/sqlean/blob/main/docs/crypto.md): Hashing, encoding and decoding data
13
+ - [SQLean::Define](https://github.com/nalgeon/sqlean/blob/main/docs/define.md): User-defined functions and dynamic SQL
14
+ - [SQLean::FileIO](https://github.com/nalgeon/sqlean/blob/main/docs/fileio.md): Reading and writing files
15
+ - [SQLean::Fuzzy](https://github.com/nalgeon/sqlean/blob/main/docs/fuzzy.md): Fuzzy string matching and phonetics
16
+ - [SQLean::IPAddr](https://github.com/nalgeon/sqlean/blob/main/docs/ipaddr.md): IP address manipulation (not supported on Windows)
17
+ - [SQLean::Math](https://github.com/nalgeon/sqlean/blob/main/docs/math.md): Math functions
18
+ - [SQLean::Regexp](https://github.com/nalgeon/sqlean/blob/main/docs/regexp.md): Regular expressions
19
+ - [SQLean::Stats](https://github.com/nalgeon/sqlean/blob/main/docs/stats.md): Math statistics
20
+ - [SQLean::Text](https://github.com/nalgeon/sqlean/blob/main/docs/text.md): String functions
21
+ - [SQLean::Unicode](https://github.com/nalgeon/sqlean/blob/main/docs/unicode.md): Unicode support
22
+ - [SQLean::UUID](https://github.com/nalgeon/sqlean/blob/main/docs/uuid.md): Universally Unique IDentifiers
23
+ - [SQLean::VSV](https://github.com/nalgeon/sqlean/blob/main/docs/vsv.md): CSV files as virtual tables
24
+
25
+
26
+ ### with SQLite3
27
+
28
+ Extend a SQLite3 database with SQLean extensions:
29
+
30
+ ``` ruby
31
+ require "sqlite3"
32
+ require "sqlean"
33
+
34
+ db = SQLite3::Database.new("path/to/db.sqlite")
35
+ db.enable_load_extension(true)
36
+
37
+ db.load_extension(SQLean.sqlite_extension_path) # load every extension in SQLean
38
+ db.load_extension(SQLean::Crypto.sqlite_extension_path) # or load individual extensions
39
+ ```
40
+
41
+ <!-- not available yet!
42
+ or, if using sqlite3 gem >= 2.4.0:
43
+
44
+ ```
45
+ db.load_extension(SQLean) # load every extension in SQLean
46
+ db.load_extension(SQLean::Crypto) # or load individual extensions
47
+ ```
48
+ -->
49
+
50
+ <!-- also not available yet!
51
+ ### with SQLite3 in Rails
52
+
53
+ When using SQLite3 v2.4.0+ and Rails 8.1.0+:
54
+
55
+ ``` yaml
56
+ # config/database.yml
57
+
58
+ development:
59
+ adapter: sqlite3
60
+ extensions:
61
+ - SQLean # load every extension in SQLean
62
+ - SQLean::Crypto # or load individual extensions
63
+ ```
64
+ -->
65
+
66
+ ### with Extralite
67
+
68
+ Extend an Extralite database with SQLean extensions:
69
+
70
+ ``` ruby
71
+ require "extralite"
72
+ require "sqlean"
73
+
74
+ db = Extralite::Database.new("path/to/db.sqlite")
75
+
76
+ db.load_extension(SQLean.sqlite_extension_path) # load every extension in SQLean
77
+ db.load_extension(SQLean::Crypto.sqlite_extension_path) # or load individual extensions
78
+ ```
79
+
80
+
81
+ ## Installation
82
+
83
+ Install the gem and add to the application's Gemfile by executing:
84
+
85
+ ```bash
86
+ bundle add sqlean
87
+ ```
88
+
89
+ If bundler is not being used to manage dependencies, install the gem by executing:
90
+
91
+ ```bash
92
+ gem install sqlean
93
+ ```
94
+
95
+ Note that right now, the only platforms supported are:
96
+
97
+ - MacOS / Darwin:
98
+ - x86_64
99
+ - arm64
100
+ - Linux
101
+ - x86_64 gnu
102
+ - x86_64 musl
103
+ - aarch64 gnu
104
+ - Windows
105
+ - mingw (64-bit)
106
+
107
+ Specifically what's missing is support for:
108
+
109
+ - Linux aarch64 musl
110
+ - Windows mingw32 (32-bit)
111
+
112
+ If you need support for one of these platforms, please open an issue. I would also gladly welcome folks who are willing to help add support.
113
+
114
+
115
+ ## Development
116
+
117
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
118
+
119
+
120
+ ## Contributing
121
+
122
+ Bug reports and pull requests are welcome on GitHub at https://github.com/flavorjones/sqlean-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/flavorjones/sqlean-ruby/blob/main/CODE_OF_CONDUCT.md).
123
+
124
+
125
+ ## License
126
+
127
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
128
+
129
+
130
+ ## Code of Conduct
131
+
132
+ Everyone interacting in the sqlean-ruby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/flavorjones/sqlean-ruby/blob/main/CODE_OF_CONDUCT.md).
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SQLean
4
+ module Upstream
5
+ # The version of upstream sqlean extensions used.
6
+ VERSION = "0.27.1"
7
+
8
+ # rubygems platform name => upstream release filename fragment
9
+ NATIVE_PLATFORMS = {
10
+ "aarch64-linux-gnu" => "linux-arm64",
11
+ "x86_64-linux-gnu" => "linux-x86",
12
+ "x86_64-linux-musl" => "linux-x86-musl",
13
+
14
+ "arm64-darwin" => "macos-arm64",
15
+ "x86_64-darwin" => "macos-x86",
16
+
17
+ "x64-mingw" => "win-x64"
18
+ }
19
+ end
20
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SQLean
4
+ # The version of the SQLean gem.
5
+ VERSION = "0.2.0"
6
+ end
data/lib/sqlean.rb ADDED
@@ -0,0 +1,148 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "sqlean/version"
4
+ require_relative "sqlean/upstream"
5
+
6
+ # https://github.com/nalgeon/sqlean/blob/main/README.md
7
+ module SQLean
8
+ class UnsupportedPlatform < StandardError; end
9
+
10
+ GEM_NAME = "sqlean"
11
+
12
+ # Returns an absolute path to the SQLean bundle, containing all the SQLean extensions.
13
+ def self.sqlite_extension_path
14
+ SQLean.file_path("sqlean")
15
+ end
16
+
17
+ # https://github.com/nalgeon/sqlean/blob/main/docs/crypto.md
18
+ module Crypto
19
+ # Returns an absolute path to the SQLean crypto extension.
20
+ def self.sqlite_extension_path
21
+ SQLean.file_path("crypto")
22
+ end
23
+ end
24
+
25
+ # https://github.com/nalgeon/sqlean/blob/main/docs/define.md
26
+ module Define
27
+ # Returns an absolute path to the SQLean define extension.
28
+ def self.sqlite_extension_path
29
+ SQLean.file_path("define")
30
+ end
31
+ end
32
+
33
+ # https://github.com/nalgeon/sqlean/blob/main/docs/fileio.md
34
+ module FileIO
35
+ # Returns an absolute path to the SQLean fileio extension.
36
+ def self.sqlite_extension_path
37
+ SQLean.file_path("fileio")
38
+ end
39
+ end
40
+
41
+ # https://github.com/nalgeon/sqlean/blob/main/docs/fuzzy.md
42
+ module Fuzzy
43
+ # Returns an absolute path to the SQLean fuzzy extension.
44
+ def self.sqlite_extension_path
45
+ SQLean.file_path("fuzzy")
46
+ end
47
+ end
48
+
49
+ # https://github.com/nalgeon/sqlean/blob/main/docs/ipaddr.md
50
+ module IPAddr
51
+ # Returns an absolute path to the SQLean ipaddr extension.
52
+ def self.sqlite_extension_path
53
+ SQLean.file_path("ipaddr")
54
+ end
55
+ end
56
+
57
+ # https://github.com/nalgeon/sqlean/blob/main/docs/math.md
58
+ module Math
59
+ # Returns an absolute path to the SQLean math extension.
60
+ def self.sqlite_extension_path
61
+ SQLean.file_path("math")
62
+ end
63
+ end
64
+
65
+ # https://github.com/nalgeon/sqlean/blob/main/docs/regexp.md
66
+ module Regexp
67
+ # Returns an absolute path to the SQLean regexp extension.
68
+ def self.sqlite_extension_path
69
+ SQLean.file_path("regexp")
70
+ end
71
+ end
72
+
73
+ # https://github.com/nalgeon/sqlean/blob/main/docs/stats.md
74
+ module Stats
75
+ # Returns an absolute path to the SQLean stats extension.
76
+ def self.sqlite_extension_path
77
+ SQLean.file_path("stats")
78
+ end
79
+ end
80
+
81
+ # https://github.com/nalgeon/sqlean/blob/main/docs/text.md
82
+ module Text
83
+ # Returns an absolute path to the SQLean text extension.
84
+ def self.sqlite_extension_path
85
+ SQLean.file_path("text")
86
+ end
87
+ end
88
+
89
+ # https://github.com/nalgeon/sqlean/blob/main/docs/time.md
90
+ module Time
91
+ # Returns an absolute path to the SQLean text extension.
92
+ def self.sqlite_extension_path
93
+ SQLean.file_path("time")
94
+ end
95
+ end
96
+
97
+ # https://github.com/nalgeon/sqlean/blob/main/docs/unicode.md
98
+ module Unicode
99
+ # Returns an absolute path to the SQLean unicode extension.
100
+ def self.sqlite_extension_path
101
+ SQLean.file_path("unicode")
102
+ end
103
+ end
104
+
105
+ # https://github.com/nalgeon/sqlean/blob/main/docs/uuid.md
106
+ module UUID
107
+ # Returns an absolute path to the SQLean uuid extension.
108
+ def self.sqlite_extension_path
109
+ SQLean.file_path("uuid")
110
+ end
111
+ end
112
+
113
+ # https://github.com/nalgeon/sqlean/blob/main/docs/vsv.md
114
+ module VSV
115
+ # Returns an absolute path to the SQLean vsv extension.
116
+ def self.sqlite_extension_path
117
+ SQLean.file_path("vsv")
118
+ end
119
+ end
120
+
121
+ #
122
+ # "private" methods
123
+ #
124
+ def self.file_path(name) # :nodoc:
125
+ File.join(SQLean.file_dir, name)
126
+ end
127
+
128
+ def self.file_dir # :nodoc:
129
+ @file_arch ||= begin
130
+ check_arch
131
+
132
+ Dir.glob(File.join(__dir__, "sqlean", "dist", "*")).find do |f|
133
+ Gem::Platform.match_gem?(Gem::Platform.new(File.basename(f)), GEM_NAME)
134
+ end
135
+ end
136
+ end
137
+
138
+ def self.check_arch # :nodoc:
139
+ if SQLean::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match_gem?(Gem::Platform.new(p), GEM_NAME) }
140
+ raise UnsupportedPlatform, "#{GEM_NAME} does not support the #{platform} platform."
141
+ end
142
+ end
143
+
144
+ # here mostly for testing purposes (to stub)
145
+ def self.platform # :nodoc:
146
+ RUBY_PLATFORM
147
+ end
148
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sqlean
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: x86_64-linux-musl
6
+ authors:
7
+ - Mike Dalessio
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-11-24 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |
14
+ Precompiled SQLean extensions for SQLite, packaged for the Ruby ecosystem. Compatible with
15
+ SQLite3, Extralite, and any other sqlite-based library that exposes sqlite3_load_extension.
16
+ email:
17
+ - mike.dalessio@gmail.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - CHANGELOG.md
23
+ - LICENSE-DEPENDENCIES.txt
24
+ - LICENSE.txt
25
+ - README.md
26
+ - lib/sqlean.rb
27
+ - lib/sqlean/dist/x86_64-linux-musl/crypto.so
28
+ - lib/sqlean/dist/x86_64-linux-musl/define.so
29
+ - lib/sqlean/dist/x86_64-linux-musl/fileio.so
30
+ - lib/sqlean/dist/x86_64-linux-musl/fuzzy.so
31
+ - lib/sqlean/dist/x86_64-linux-musl/ipaddr.so
32
+ - lib/sqlean/dist/x86_64-linux-musl/math.so
33
+ - lib/sqlean/dist/x86_64-linux-musl/regexp.so
34
+ - lib/sqlean/dist/x86_64-linux-musl/sqlean.so
35
+ - lib/sqlean/dist/x86_64-linux-musl/stats.so
36
+ - lib/sqlean/dist/x86_64-linux-musl/text.so
37
+ - lib/sqlean/dist/x86_64-linux-musl/time.so
38
+ - lib/sqlean/dist/x86_64-linux-musl/unicode.so
39
+ - lib/sqlean/dist/x86_64-linux-musl/uuid.so
40
+ - lib/sqlean/dist/x86_64-linux-musl/vsv.so
41
+ - lib/sqlean/upstream.rb
42
+ - lib/sqlean/version.rb
43
+ homepage: https://github.com/flavorjones/sqlean-ruby
44
+ licenses:
45
+ - MIT
46
+ metadata:
47
+ homepage_uri: https://github.com/flavorjones/sqlean-ruby
48
+ source_code_uri: https://github.com/flavorjones/sqlean-ruby
49
+ changelog_uri: https://github.com/flavorjones/sqlean-ruby/blob/main/CHANGELOG.md
50
+ rubygems_mfa_required: 'true'
51
+ post_install_message:
52
+ rdoc_options: []
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 3.0.0
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ requirements: []
66
+ rubygems_version: 3.5.22
67
+ signing_key:
68
+ specification_version: 4
69
+ summary: Precompiled SQLean extensions for SQLite, packaged for the Ruby ecosystem.
70
+ test_files: []