Hi, Gary,
the 'import' command can be used on ssdb-cli, however it can not be used here.
the ssdb-cli is coded as follows:
1. check the cmd
if cmd == 'import' then
some the import work by importer
else cmd == 'export then
do the export work
else ....
if normal cmd then
send the cmd (with args) to the net server of the ssdb
....
2. the importer do this kind of job
2.1 read the content by line from the file
2.2 parse the line to cmd and args
2.3 send the cmd (with args) to the net server of the ssdb
the 3 steps are done in a loop ,cuz line by line
where when we r using something like ssdb lib for openresty, we r sending cmd to the net server of the ssdb directly.
the 'import' cmd is not a valid cmd for it.
zhao...@gmail.com
On Wednesday, November 21, 2018 at 9:13:25 PM UTC+8, Gary Madarm wrote:
On Wednesday, November 21, 2018 at 10:18:39 AM UTC+2,
zhao...@gmail.com wrote:
SSDB supports importing an entire file (
http://ssdb.io/docs/backup.html) which appears to be faster then running db:hset('some-key', 'some-value') individually for each hashmap. I was hoping to be able to automate that instead of parsing the file line by line and setting each hashmap separately.
- G.
On Wednesday, November 21, 2018 at 4:46:32 AM UTC+8, Gary Madarm wrote:
How can I use the import command in risent/lua-resty-ssdb to do a bulk import of key value pairs to the db?
When I try running the import command via:
ok, err = db:import(f)
or even after adding the command via:
ssdb.add_commands("import")
I still get the error:
Unknown Command: import
How can I import a file into ssdb via OpenResty?
thank you