Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser.js:193 parseError #183

Open
Cariaga opened this issue Oct 22, 2019 · 0 comments
Open

parser.js:193 parseError #183

Cariaga opened this issue Oct 22, 2019 · 0 comments

Comments

@Cariaga
Copy link

@Cariaga Cariaga commented Oct 22, 2019

Current Version
"nano-redis": "^1.7.2",
"nano-sql": "^1.8.5",

Expecting Error

ReplyError: ERR unknown command 'zscan'

  - parser.js:193 parseError
    [RealTimeServer]/[redis-parser]/lib/parser.js:193:12

  - parser.js:303 parseType
    [RealTimeServer]/[redis-parser]/lib/parser.js:303:14
Code
const nSQL = require("nano-sql").nSQL;
const RedisAdapter = require("nano-redis").RedisAdapter;

nSQL("users") // table name
.model([ // data model
    {key: "id", type: "uuid", props: ["pk"]}, // primary key
    {key: "name", type: "string"},
    {key: "age", type: "int", props: ["idx"]} // secondary index
])
.config({
    mode: new RedisAdapter({ // required
        // identical to config object for https://www.npmjs.com/package/redis
        host: "localhost"
    })
}).connect().then(() => {
    // add record
    return nSQL("users").query("upsert", {name: "Jeb", age: 30}).exec();
})
.catch((error)=>{
  console.log(error);
})

.then(() => {
  //select record
 return nSQL("users").query("select").exec();
})
.catch((error)=>{
  console.log(error);
})
.then((rows) => {
  console.log(rows) // [{id: "1df52039af3d-a5c0-4ca9-89b7-0e89aad5a61e", name: "Jeb", age: 30}]
})
.catch((error)=>{
  console.log(error);
})
.then(() => {
  // delete record
  return nSQL("users").query("delete", {name: "Jeb", age: 30}).exec();
})
.catch((error)=>{
console.log(error);
})
;

My other packages

    "byteof": "^0.1.1",
    "chai": "^4.2.0",
    "chai-as-promised": "^7.1.1",
    "cron-cluster": "^1.1.3",
    "express": "^4.17.1",
    "fast-safe-stringify": "^2.0.7",
    "helmet": "^3.21.1",
    "http": "0.0.0",
    "ioredis": "^4.14.1",
    "multi-loggerjs": "^1.0.0",
    "nano-redis": "^1.7.2",
    "nano-sql": "^1.8.5",
    "needle": "^2.4.0",
    "path": "^0.12.7",
    "pretty-error": "^2.1.1",
    "redis": "2.8.0",
    "socket.io": "^2.3.0",
    "socket.io-monitor": "^2.0.1",
    "socket.io-redis": "^5.2.0",
    "socketio-jwt-auth": "^0.1.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.