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

INSERT with CONTENT synax error when using named params v3.0.x #8666

Closed
myflowpl opened this issue Nov 18, 2018 · 4 comments
Closed

INSERT with CONTENT synax error when using named params v3.0.x #8666

myflowpl opened this issue Nov 18, 2018 · 4 comments
Assignees
Labels
Milestone

Comments

@myflowpl
Copy link

OrientDB Version: 3.0.10
Java Version: 1.8.0_111
OS: Ubuntu 18.04
OrientJS Version: 3.0.1
and the same error with Java driver as mentioned here: orientechnologies/orientjs#346

this works if you put json inline:

session.command('INSERT INTO Log CONTENT {test: "inline json"}')

and this not if you use named parameters:

session.command( 'INSERT INTO Log CONTENT :log',  {
    params: {log: { test: 'json in params' }}
})

it throws error:

OrientDB.RequestError: Error parsing query:
      INSERT INTO Log CONTENT ":log"
                            ^
      Encountered " <CONTENT> "CONTENT "" at line 1, column 17.
      Was expecting one of:
          <EOF> 
          <SELECT> ...
          <FROM> ...
          <RETURN> ...
          <UNSAFE> ...
          "(" ...
          ";" ...
          <CLUSTER> ...
          "(" ...
          
      	DB name="smdb_dev"
      	Error Code="1"
      at child.Object.<anonymous>.Operation.parseError (node_modules/orientjs/lib/client/network/protocol37/operation.js:1224:13)
      at child.Object.<anonymous>.Operation.consume (node_modules/orientjs/lib/client/network/protocol37/operation.js:566:35)
      at ONetworkConnection.Object.<anonymous>.Connection.process (node_modules/orientjs/lib/client/network/conn.js:460:17)
      at ONetworkConnection.Object.<anonymous>.Connection.handleSocketData (node_modules/orientjs/lib/client/network/conn.js:342:20)

It was working on 2.2 version
any ideas what i'm doing wrong ?

@luigidellaquila
Copy link
Member

Hi @myflowpl

OrientDB v 3.0 does not support parameters for INSERT CONTENT, but it should be an easy addition. I'll work on it asap and let you know

Thanks

Luigi

@luigidellaquila luigidellaquila self-assigned this Nov 19, 2018
@myflowpl
Copy link
Author

Thanks @luigidellaquila for quick answer.
This is very use full syntax, and if it's quick it will be really helpful to have it back.

Other way it should be added to the 3.0 migration guide as breaking change.
I check the migration guide before and couldn't find any info about it

waiting for your info

@luigidellaquila
Copy link
Member

Hi @myflowpl

I think this particular this just fell through the cracks (we can consider it a regression)

Thanks

Luigi

luigidellaquila added a commit that referenced this issue Nov 20, 2018
@luigidellaquila
Copy link
Member

Hi @myflowpl

I just pushed a fix to 3.0.x, it will be released with v 3.0.11

Thanks

Luigi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants