epsilla 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- 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 +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2f93452eaa34144e3ac683011ea730c5016424d7cca20d13ee44d3c7009b4ba
|
4
|
+
data.tar.gz: df9b3556d0c0ebae52e7941e34cd88835139a0490f146bb607ffa527ae99a88a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 556f8488b11442cbc97fe8098037379b3cd40b326e4fc25102b6af66af39cb3ca1812a27ce4f106ecd0af111c8425492198d0a4057a419695f5a01ed3211ba71
|
7
|
+
data.tar.gz: 16dc1eb071091b184a49fdcc54d24fef16750096f57c1d1b878830bd22cea3670f4900cd4084d67f8934828b70bf2525fc3fe43f76a32da8b16196be50b2bd08
|
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,27 +1,27 @@
|
|
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.4
|
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-
|
11
|
+
date: 2023-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1'
|
27
27
|
description: EpsillaDB is a scalable, high-performance, and cost-effective vector
|
@@ -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
|