neo4j / neo4j-javascript-driver

Neo4j Bolt driver for JavaScript

Home Page:https://neo4j.com/docs/javascript-manual/current/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

:auto statement not working

mipcios opened this issue · comments

Bug Report

When executing this query from a nodejs app
:auto LOAD CSV WITH HEADERS FROM "file:///file.csv" AS csvLine FIELDTERMINATOR ';' CALL { ... } IN TRANSACTIONS

I get the following error:

Neo4jError: Invalid input ':': expected
  "ALTER"
  "CALL"
  "CREATE"
  "DEALLOCATE"
  "DELETE"
  "DENY"
  "DETACH"
  "DROP"
  "DRYRUN"
  "ENABLE"
  "FOREACH"
  "GRANT"
  "LOAD"
  "MATCH"
  "MERGE"
  "OPTIONAL"
  "REALLOCATE"
  "REMOVE"
  "RENAME"
  "RETURN"
  "REVOKE"
  "SET"
  "SHOW"
  "START"
  "STOP"
  "TERMINATE"
  "UNWIND"
  "USE"
  "USING"
  "WITH" (line 1, column 1 (offset: 0))
":auto LOAD CSV WITH HEADERS FROM "file:///file.csv" AS csvLine FIELDTERMINATOR ';'     CALL {   ...  } IN TRANSACTIONS;"

I can execute that query from the browser with no issue at all.

My Environment

Javascript Runtime Version: node 20
Neo4j Version: 5.7.0
neo4j-driver: 5.11.0
Operating System: Ubuntu 20.04

Hey @mipcios, thanks for reporting.

this is not an issue. Browser has a set of commands started : which are not cypher code, but special Browser commands.

Afaik, The :auto command runs the query in a auto-commit transaction. This can be done in the driver by calling session.run("your query", params).

Okey, thanks for the input. Great library.