epsilla-ruby 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25bffa748aef3218e358bd1654671fa90e847f19aeedb9a7867860f92b65e058
4
- data.tar.gz: 9c7aac7a583e92850edae060676fc188fa60b455c70743fc9a6a83e1f85aa491
3
+ metadata.gz: 9435435295698aa14f7b69b1d1f333e8c1a13a2304d6e518526f6087fc0a8524
4
+ data.tar.gz: fadf46bfa45376d0273fdd13ad843bd136670957ef00e2a9be44d995d0de94a8
5
5
  SHA512:
6
- metadata.gz: 68161fdd3e73a044edc538751c4660c74a5419b19dc1bc3346d0bd42201e5af9cb316ff0602786dbd4097d2ac19a6d28930d05f168bff8166b8ebacb70d42132
7
- data.tar.gz: 0e5aa3311a2c3312d411c8ea97cb7e1a03cc2e012eda5aa1acbb08ab9992afe443acb600b7ac64d4efcd1e4625c026ba444d96e205deb0a34302a1dba676627b
6
+ metadata.gz: 7ef95679ea6ed03945b9992f7840eb37499cf2457fb7d9269e6a4f98ee1eb71d828e8df517550299a540c49359597e0c9f66cb6810cb9dee04946fac33e20c4f
7
+ data.tar.gz: e0b972ee620c489b888ed7b21132ae6fb5d844fa16af264b2d2917b314a40829627bf4136f0fea9264603f13226470567805fac95bbf9a5cb50f44190706b9d7
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
data/epsilla.gemspec ADDED
@@ -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"
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
+
@@ -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]},
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Epsilla
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epsilla-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
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-17 00:00:00.000000000 Z
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.gemspec
38
39
  - examples/hello_epsilla.rb
39
40
  - lib/epsilla.rb
40
41
  - lib/epsilla/base.rb