epsilla 0.0.2 → 0.0.3
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 +4 -4
- data/CHANGELOG.md +0 -0
- data/README.md +3 -1
- data/epsilla-ruby.gemspec +94 -0
- data/examples/hello_epsilla.rb +4 -0
- data/lib/epsilla/base.rb +0 -0
- data/lib/epsilla/database.rb +13 -0
- data/lib/epsilla/error.rb +0 -0
- data/lib/epsilla/health.rb +0 -0
- data/lib/epsilla/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 992c6ea719370841f7123840d26bf21fbb42077a2540a7b1ffa8e6ca25c851ba
|
4
|
+
data.tar.gz: 0ccebd514515b16c9a811fd244a168235f6f06563c5a39b2e2c7109834455e2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9231c203f1ba09b7d103f7c4a9532a2c757cf6e6f6c9eab5fc3d0e503ca4d921fad69464130d3bcfacb849663959a3eb47a8a4181d0e547ccd693e0f37052d08
|
7
|
+
data.tar.gz: 8760e5a3f3483c41454e67d75407a94b26b9b7b4cc60195370354d785a9d2598fb77f06b81c12fe860e936abc2d32e88b7ff7dbd4d319ac187688d20720b8a25
|
data/CHANGELOG.md
CHANGED
File without changes
|
data/README.md
CHANGED
@@ -80,4 +80,6 @@ puts status_code, response
|
|
80
80
|
```
|
81
81
|
|
82
82
|
## Contributing
|
83
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/epsilla-cloud/epsilla-ruby
|
83
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/epsilla-cloud/epsilla-ruby-client
|
84
|
+
|
85
|
+
If you have any question or problem, please join our discord https://discord.com/invite/cDaY2CxZc5
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/epsilla/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "epsilla-ruby"
|
7
|
+
spec.version = Epsilla::VERSION
|
8
|
+
spec.authors = ["Epsilla Team"]
|
9
|
+
spec.email = ["eric@epsilla.com"]
|
10
|
+
|
11
|
+
spec.summary = "Ruby client for Epsilla Vector Database"
|
12
|
+
spec.description = "EpsillaDB is a scalable, high-performance, and cost-effective vector database"
|
13
|
+
spec.homepage = "https://github.com/epsilla-cloud/vectordb"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 2.6.0"
|
16
|
+
|
17
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
18
|
+
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
+
spec.metadata["source_code_uri"] = "https://github.com/epsilla-cloud/epsilla-ruby-client"
|
21
|
+
spec.metadata["changelog_uri"] = "https://github.com/epsilla-cloud/epsilla-ruby-client/blob/main/CHANGELOG.md"
|
22
|
+
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
+
spec.files = Dir.chdir(__dir__) do
|
26
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor|Gemfile)})
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
spec.bindir = "exe"
|
32
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
33
|
+
spec.require_paths = ["lib"]
|
34
|
+
|
35
|
+
# Uncomment to register a new dependency of your gem
|
36
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
37
|
+
spec.add_dependency "faraday", "~> 1"
|
38
|
+
|
39
|
+
# For more information and examples about making a new gem, check out our
|
40
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
# lib = File.expand_path("../lib", __FILE__)
|
55
|
+
# $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
56
|
+
# require "epsilla/version"
|
57
|
+
|
58
|
+
# Gem::Specification.new do |spec|
|
59
|
+
# spec.name = "epsilla"
|
60
|
+
# spec.version = Epsilla::VERSION
|
61
|
+
# spec.authors = ["Epsilla Team"]
|
62
|
+
# spec.email = ["eric@epsilla.com", "admin@epsilla.com"]
|
63
|
+
|
64
|
+
# spec.summary = "A scalable, high-performance, and cost-effective vector database"
|
65
|
+
# spec.description = "A scalable, high-performance, and cost-effective vector database"
|
66
|
+
# spec.homepage = "https://github.com/epsilla-cloud/vectordb"
|
67
|
+
# spec.license = "MIT"
|
68
|
+
# # spec.required_ruby_version = ">= 3.0.0"
|
69
|
+
|
70
|
+
# # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
71
|
+
# # to allow pushing to a single host or delete this section to allow pushing to any host.
|
72
|
+
# if spec.respond_to?(:metadata)
|
73
|
+
# #spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
74
|
+
# spec.metadata["homepage_uri"] = spec.homepage
|
75
|
+
# spec.metadata["source_code_uri"] = "https://github.com/eric-epsilla/epsilla-ruby"
|
76
|
+
# spec.metadata["changelog_uri"] = "https://github.com/eric-epsilla/epsilla-ruby"
|
77
|
+
# else
|
78
|
+
# raise "RubyGems 3.0 or newer is required to protect against " \
|
79
|
+
# "public gem pushes."
|
80
|
+
# end
|
81
|
+
|
82
|
+
# # Specify which files should be added to the gem when it is released.
|
83
|
+
# # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
84
|
+
# spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
85
|
+
# `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
86
|
+
# end
|
87
|
+
# spec.bindir = "exe"
|
88
|
+
# spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
89
|
+
# spec.require_paths = ["lib"]
|
90
|
+
|
91
|
+
# spec.add_dependency "faraday", "~> 1"
|
92
|
+
# spec.add_development_dependency "bundler", "~> 1.17"
|
93
|
+
# end
|
94
|
+
|
data/examples/hello_epsilla.rb
CHANGED
@@ -30,6 +30,10 @@ table_fields= [
|
|
30
30
|
status_code, response = client.database.create_table(table_name="MyTable", table_fields=table_fields)
|
31
31
|
puts status_code, response
|
32
32
|
|
33
|
+
# List tables
|
34
|
+
status_code, response = client.database.list_tables()
|
35
|
+
puts status_code, response
|
36
|
+
|
33
37
|
# Insert new vector records into table
|
34
38
|
table_records = [
|
35
39
|
{"ID" => 1, "Doc" => "Berlin", "Embedding" => [0.05, 0.61, 0.76, 0.74]},
|
data/lib/epsilla/base.rb
CHANGED
File without changes
|
data/lib/epsilla/database.rb
CHANGED
@@ -45,6 +45,19 @@ module Epsilla
|
|
45
45
|
return response.status, response.body
|
46
46
|
end
|
47
47
|
|
48
|
+
# get a list of table names in current DB
|
49
|
+
def list_tables()
|
50
|
+
unless @db_name
|
51
|
+
raise Exception("[ERROR] Please use_db() first!")
|
52
|
+
end
|
53
|
+
|
54
|
+
response = client.connection.post do |req|
|
55
|
+
req.url "/api/#{@db_name}/schema/tables/show"
|
56
|
+
end
|
57
|
+
|
58
|
+
return response.status, response.body
|
59
|
+
end
|
60
|
+
|
48
61
|
# insert data into table
|
49
62
|
def insert(table_name = "MyTable", table_records = nil)
|
50
63
|
unless @db_name
|
data/lib/epsilla/error.rb
CHANGED
File without changes
|
data/lib/epsilla/health.rb
CHANGED
File without changes
|
data/lib/epsilla/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epsilla
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Epsilla Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- CHANGELOG.md
|
36
36
|
- README.md
|
37
37
|
- Rakefile
|
38
|
+
- epsilla-ruby.gemspec
|
38
39
|
- examples/hello_epsilla.rb
|
39
40
|
- lib/epsilla.rb
|
40
41
|
- lib/epsilla/base.rb
|