sqlite_server2018 0.1.0

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: dd9b32f9d2cded96ec8507080d022dffb0dee241455f7b83d00b182f01588cb3
4
+ data.tar.gz: 8f28af8170911f658b617367a4cf6b03352614a23bba003244e59b156ab912b1
5
+ SHA512:
6
+ metadata.gz: 36d684cc42b3b905428aeb9c3a647cf669b91ce8baf459fb5b7688f4e14c3dea77a502656e8578068a8c27cf1cbdc38d9b7c1cc9125d15bd7cac7763be680221
7
+ data.tar.gz: 734e4ff31cf4002c73f58025c1f21ab22044619a23a68b190191ad8d49617d2c8481900c70d42da69992bad1ca474e3247d5649e879ac0e98353d3f20dcc16f7
checksums.yaml.gz.sig ADDED
Binary file
data.tar.gz.sig ADDED
Binary file
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: sqlite_server2018.rb
4
+
5
+ require 'drb'
6
+ require 'sqlite3'
7
+ require 'hashcache'
8
+
9
+
10
+ class SQLiteServer
11
+ include SQLite3
12
+
13
+ def initialize(cache: 5, debug: false)
14
+
15
+ @dbcache = HashCache.new(cache: cache)
16
+ @h = {}
17
+ @debug = debug
18
+
19
+ end
20
+
21
+ def execute(dbfile, *args, &blk)
22
+
23
+ p 'dbfile: ' + dbfile if @debug
24
+ db = Database.new dbfile
25
+
26
+ if @debug then
27
+ p 'db: ' + db.inspect
28
+ p 'args: ' + args.inspect
29
+ end
30
+
31
+ begin
32
+ read(dbfile).execute(*args, &blk)
33
+ rescue
34
+ ($!).inspect
35
+ end
36
+
37
+ end
38
+
39
+ def load(dbfile)
40
+ read dbfile
41
+ 'loaded'
42
+ end
43
+
44
+ def query(*args, &blk)
45
+
46
+ begin
47
+ read(dbfile).query(*args, &blk)
48
+ rescue
49
+ ($!).inspect
50
+ end
51
+
52
+ end
53
+
54
+ private
55
+
56
+ def read(dbfile)
57
+ @dbcache.read(dbfile) { Database.new dbfile }
58
+ end
59
+
60
+ end
61
+
62
+ class SQLiteServer2018
63
+
64
+ def initialize(host: 'localhost', port: '57000', cache: 5)
65
+
66
+ @host, @port, @cache = host, port, cache
67
+
68
+ end
69
+
70
+ def start()
71
+
72
+ DRb.start_service "druby://#{@host}:#{@port}",
73
+ SQLiteServer.new(cache: @cache)
74
+ DRb.thread.join
75
+
76
+ end
77
+ end
78
+
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sqlite_server2018
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
14
+ YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTgwODI4MTcyNjE2WhcN
15
+ MTkwODI4MTcyNjE2WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
+ cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDqRBTy
17
+ oFo32IGDvvw/JtiryhTRSf7Tu5l6NaXHocYrrTQk3KsAaJnNTSdwmZivPpjpkv54
18
+ TB7mW0IRt75CKgWH0ooRwf3ra+hcIa7E6L+QnBtkyHieUyTlrSJhpdtHny7NYBLA
19
+ Cr5VdzRVs0k+TFnbmJlSFgoJJ915nDxa8IaTj5yJUJSw6XyQWtcV0OxDd4SeuV58
20
+ WKfQh07RQUvnX/VAnz1mGUrwnQM5Zt4nxlA8IOdmJHJAu1rcHpq8sqYFc2/75Zyz
21
+ yysDQnski7g/GWMxMFVJaLZb6NAU6UfFI7kJ6fiSQVCAi608MPINgEGPmy81F0nL
22
+ 7+DXq4WAspRhY0PEKQqgDPtn4KBIZ5M8BChf8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+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.3'
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 1.3.13
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '1.3'
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 1.3.13
60
+ - !ruby/object:Gem::Dependency
61
+ name: hashcache
62
+ requirement: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '0.2'
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 0.2.10
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '0.2'
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: 0.2.10
80
+ description:
81
+ email: james@jamesrobertson.eu
82
+ executables: []
83
+ extensions: []
84
+ extra_rdoc_files: []
85
+ files:
86
+ - lib/sqlite_server2018.rb
87
+ homepage: https://github.com/jrobertson/sqlite_server2018
88
+ licenses:
89
+ - MIT
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.7.6
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: Enables SQLite database access from a DRb server.
111
+ test_files: []
metadata.gz.sig ADDED
Binary file