sqlean 0.1.0-arm64-darwin

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: 17fd8a46db99a01a69269ffa6e4538c134151366677f36c5d07a36b7da2388dc
4
+ data.tar.gz: 547e4bc2c6327d2804ac9dcb3c1ba9f0a6432c819f3ad36b29a1df0f9ab2489f
5
+ SHA512:
6
+ metadata.gz: fa71f076575fee845200dae5298650773b85752d34f4b9ddfc1ba5918a0a63d21749c917da3c208eea16e74ed631398919dbb530f622e9dad3f81a070b973985
7
+ data.tar.gz: 2b754a7745d1980bcd229bd5baddd78f5698a7eb164f3d4d60efa31cb793966342f6b9cd8a574428d153d487b5aef7c6384bcaec6dfd2c79936a1be63b80cb0d
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2024-11-23
4
+
5
+ - Initial 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,113 @@
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
+
96
+ ## Development
97
+
98
+ 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.
99
+
100
+
101
+ ## Contributing
102
+
103
+ 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).
104
+
105
+
106
+ ## License
107
+
108
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
109
+
110
+
111
+ ## Code of Conduct
112
+
113
+ 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,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SQLean
4
+ module Upstream
5
+ VERSION = "0.27.1"
6
+
7
+ # rubygems platform name => upstream release filename fragment
8
+ NATIVE_PLATFORMS = {
9
+ "aarch64-linux" => "linux-arm64",
10
+ "x86_64-linux" => "linux-x86",
11
+
12
+ "arm64-darwin" => "macos-arm64",
13
+ "x86_64-darwin" => "macos-x86",
14
+
15
+ "x64-mingw" => "win-x64"
16
+ }
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SQLean
4
+ VERSION = "0.1.0"
5
+ end
data/lib/sqlean.rb ADDED
@@ -0,0 +1,165 @@
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
+ WINDOWS_PLATFORM_REGEX = /mingw|mswin/ # :nodoc:
12
+ LINUX_PLATFORM_REGEX = /linux/ # :nodoc:
13
+ DARWIN_PLATFORM_REGEX = /darwin/ # :nodoc:
14
+
15
+ # Returns an absolute path to the SQLean bundle, containing all the SQLean extensions.
16
+ def self.sqlite_extension_path
17
+ SQLean.file_path("sqlean")
18
+ end
19
+
20
+ # https://github.com/nalgeon/sqlean/blob/main/docs/crypto.md
21
+ module Crypto
22
+ # Returns an absolute path to the SQLean crypto extension.
23
+ def self.sqlite_extension_path
24
+ SQLean.file_path("crypto")
25
+ end
26
+ end
27
+
28
+ # https://github.com/nalgeon/sqlean/blob/main/docs/define.md
29
+ module Define
30
+ # Returns an absolute path to the SQLean define extension.
31
+ def self.sqlite_extension_path
32
+ SQLean.file_path("define")
33
+ end
34
+ end
35
+
36
+ # https://github.com/nalgeon/sqlean/blob/main/docs/fileio.md
37
+ module FileIO
38
+ # Returns an absolute path to the SQLean fileio extension.
39
+ def self.sqlite_extension_path
40
+ SQLean.file_path("fileio")
41
+ end
42
+ end
43
+
44
+ # https://github.com/nalgeon/sqlean/blob/main/docs/fuzzy.md
45
+ module Fuzzy
46
+ # Returns an absolute path to the SQLean fuzzy extension.
47
+ def self.sqlite_extension_path
48
+ SQLean.file_path("fuzzy")
49
+ end
50
+ end
51
+
52
+ # https://github.com/nalgeon/sqlean/blob/main/docs/ipaddr.md
53
+ module IPAddr
54
+ # Returns an absolute path to the SQLean ipaddr extension.
55
+ def self.sqlite_extension_path
56
+ SQLean.file_path("ipaddr")
57
+ end
58
+ end
59
+
60
+ # https://github.com/nalgeon/sqlean/blob/main/docs/math.md
61
+ module Math
62
+ # Returns an absolute path to the SQLean math extension.
63
+ def self.sqlite_extension_path
64
+ SQLean.file_path("math")
65
+ end
66
+ end
67
+
68
+ # https://github.com/nalgeon/sqlean/blob/main/docs/regexp.md
69
+ module Regexp
70
+ # Returns an absolute path to the SQLean regexp extension.
71
+ def self.sqlite_extension_path
72
+ SQLean.file_path("regexp")
73
+ end
74
+ end
75
+
76
+ # https://github.com/nalgeon/sqlean/blob/main/docs/stats.md
77
+ module Stats
78
+ # Returns an absolute path to the SQLean stats extension.
79
+ def self.sqlite_extension_path
80
+ SQLean.file_path("stats")
81
+ end
82
+ end
83
+
84
+ # https://github.com/nalgeon/sqlean/blob/main/docs/text.md
85
+ module Text
86
+ # Returns an absolute path to the SQLean text extension.
87
+ def self.sqlite_extension_path
88
+ SQLean.file_path("text")
89
+ end
90
+ end
91
+
92
+ # https://github.com/nalgeon/sqlean/blob/main/docs/time.md
93
+ module Time
94
+ # Returns an absolute path to the SQLean text extension.
95
+ def self.sqlite_extension_path
96
+ SQLean.file_path("time")
97
+ end
98
+ end
99
+
100
+ # https://github.com/nalgeon/sqlean/blob/main/docs/unicode.md
101
+ module Unicode
102
+ # Returns an absolute path to the SQLean unicode extension.
103
+ def self.sqlite_extension_path
104
+ SQLean.file_path("unicode")
105
+ end
106
+ end
107
+
108
+ # https://github.com/nalgeon/sqlean/blob/main/docs/uuid.md
109
+ module UUID
110
+ # Returns an absolute path to the SQLean uuid extension.
111
+ def self.sqlite_extension_path
112
+ SQLean.file_path("uuid")
113
+ end
114
+ end
115
+
116
+ # https://github.com/nalgeon/sqlean/blob/main/docs/vsv.md
117
+ module VSV
118
+ # Returns an absolute path to the SQLean vsv extension.
119
+ def self.sqlite_extension_path
120
+ SQLean.file_path("vsv")
121
+ end
122
+ end
123
+
124
+ #
125
+ # "private" methods
126
+ #
127
+ def self.file_path(name) # :nodoc:
128
+ File.join(SQLean.file_dir, "#{name}.#{SQLean.file_ext}")
129
+ end
130
+
131
+ def self.file_dir # :nodoc:
132
+ @file_arch ||= begin
133
+ check_arch
134
+
135
+ Dir.glob(File.join(__dir__, "sqlean", "dist", "*")).find do |f|
136
+ Gem::Platform.match_gem?(Gem::Platform.new(File.basename(f)), GEM_NAME)
137
+ end
138
+ end
139
+ end
140
+
141
+ def self.check_arch # :nodoc:
142
+ if SQLean::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match_gem?(Gem::Platform.new(p), GEM_NAME) }
143
+ raise UnsupportedPlatform, "#{GEM_NAME} does not support the #{platform} platform."
144
+ end
145
+ end
146
+
147
+ def self.file_ext # :nodoc:
148
+ @file_ext ||=
149
+ case platform
150
+ when WINDOWS_PLATFORM_REGEX
151
+ "dll"
152
+ when DARWIN_PLATFORM_REGEX
153
+ "dylib"
154
+ when LINUX_PLATFORM_REGEX
155
+ "so"
156
+ else
157
+ raise "Unknown or unsupported platform: #{platform}"
158
+ end
159
+ end
160
+
161
+ # here mostly for testing purposes (to stub)
162
+ def self.platform # :nodoc:
163
+ RUBY_PLATFORM
164
+ end
165
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sqlean
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: arm64-darwin
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/arm64-darwin/crypto.dylib
28
+ - lib/sqlean/dist/arm64-darwin/define.dylib
29
+ - lib/sqlean/dist/arm64-darwin/fileio.dylib
30
+ - lib/sqlean/dist/arm64-darwin/fuzzy.dylib
31
+ - lib/sqlean/dist/arm64-darwin/ipaddr.dylib
32
+ - lib/sqlean/dist/arm64-darwin/math.dylib
33
+ - lib/sqlean/dist/arm64-darwin/regexp.dylib
34
+ - lib/sqlean/dist/arm64-darwin/sqlean.dylib
35
+ - lib/sqlean/dist/arm64-darwin/stats.dylib
36
+ - lib/sqlean/dist/arm64-darwin/text.dylib
37
+ - lib/sqlean/dist/arm64-darwin/time.dylib
38
+ - lib/sqlean/dist/arm64-darwin/unicode.dylib
39
+ - lib/sqlean/dist/arm64-darwin/uuid.dylib
40
+ - lib/sqlean/dist/arm64-darwin/vsv.dylib
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: []