Skip to content

Convert to a regular JS module, add build script. #1

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

Merged
merged 1 commit into from
Oct 2, 2015

Conversation

jakewins
Copy link
Contributor

@jakewins jakewins commented Oct 2, 2015

No description provided.

jakewins added a commit that referenced this pull request Oct 2, 2015
Convert to a regular JS module, add build script.
@jakewins jakewins merged commit 57f625a into neo4j:master Oct 2, 2015
@jakewins jakewins deleted the nodejs branch October 2, 2015 17:02
lutovich added a commit to lutovich/neo4j-javascript-driver that referenced this pull request Aug 29, 2018
Bolt V3 allows additional metadata to be attached to BEGIN and RUN
messages. This makes it possible to expose couple new features in
the API.

Auto-commit transactions executed via `Session#run()` now support
bookmarks. In previous protocol versions there was no good place in
the RUN message to attach bookmarks. Auto-commit transactions will
now use bookmarks given in `Driver#session(bookmarkOrBookmarks)`
function and participate in causal chaining withing a session.

Transactions functions, auto-commit and explicit transactions now
accept a configuration object with transaction timeout and metadata.
Example of a configuration object:

```
{
    timeout: 3000, // 3 seconds
    metadata: {key1: 42, key2: '42'}
}
```

where timeout is specified in milliseconds and metadata is an object
containing valid Cypher types.

Transactions that execute longer than the configured timeout will be
terminated by the database. This functionality allows to limit
query/transaction execution time. Specified timeout overrides the
default timeout configured in the database using
`dbms.transaction.timeout` setting. Examples:

Specified transaction metadata will be attached to the executing
transaction and visible in the output of `dbms.listQueries` and
`dbms.listTransactions` procedures. It will also get logged to the
`query.log`. This functionality makes it easier to tag transactions
and is equivalent to `dbms.setTXMetaData` procedure.

Examples:

```
var driver = neo4j.driver(...);
var session = driver.session();

var txConfig = {
  timeout: 5000, // 5 seconds
  metadata: {
    type: 'My Query',
    application: 'My App neo4j#1',
    sequence_number: 42
  }
};

// transaction configuration for auto-commit transaction
session.run('RETURN $x', {x: 42}, txConfig)
       .then(...)
       .catch(...)

// transaction configuration for explicit transaction
var tx = session.beginTransaction(txConfig);
tx.run(...);

// transaction configuration for read transaction function
session.readTransaction(tx => tx.run('RETURN $x', {x: 42}), txConfig)
       .then(...)
       .catch(...)

// transaction configuration for write transaction function
session.writeTransaction(tx => tx.run('RETURN $x', {x: 42}), txConfig)
       .then(...)
       .catch(...)
```
lutovich added a commit to lutovich/neo4j-javascript-driver that referenced this pull request Aug 29, 2018
Bolt V3 allows additional metadata to be attached to BEGIN and RUN
messages. This makes it possible to expose a couple new features in
the API.

Auto-commit transactions executed via `Session#run()` now support
bookmarks. In previous protocol versions, there was no good place in
the RUN message to attach bookmarks. Auto-commit transactions will
now use bookmarks given in `Driver#session(bookmarkOrBookmarks)`
function and participate in causal chaining within a session.

Transactions functions, auto-commit, and explicit transactions now
accept a configuration object with transaction timeout and metadata.
Example of a configuration object:

```
{
    timeout: 3000, // 3 seconds
    metadata: {key1: 42, key2: '42'}
}
```

where timeout is specified in milliseconds and metadata is an object
containing valid Cypher types.

Transactions that execute longer than the configured timeout will be
terminated by the database. This functionality allows limiting
query/transaction execution time. Specified timeout overrides the
default timeout configured in the database using
`dbms.transaction.timeout` setting. Examples:

Specified transaction metadata will be attached to the executing
transaction and visible in the output of `dbms.listQueries` and
`dbms.listTransactions` procedures. It will also get logged to the
`query.log`. This functionality makes it easier to tag transactions
and is equivalent to `dbms.setTXMetaData` procedure.

Examples:

```
var driver = neo4j.driver(...);
var session = driver.session();

var txConfig = {
  timeout: 5000, // 5 seconds
  metadata: {
    type: 'My Query',
    application: 'My App neo4j#1',
    sequence_number: 42
  }
};

// transaction configuration for auto-commit transaction
session.run('RETURN $x', {x: 42}, txConfig)
       .then(...)
       .catch(...)

// transaction configuration for explicit transaction
var tx = session.beginTransaction(txConfig);
tx.run(...);

// transaction configuration for read transaction function
session.readTransaction(tx => tx.run('RETURN $x', {x: 42}), txConfig)
       .then(...)
       .catch(...)

// transaction configuration for write transaction function
session.writeTransaction(tx => tx.run('RETURN $x', {x: 42}), txConfig)
       .then(...)
       .catch(...)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant