Module: mysqlx

Members


<static, constant> LockContention :Locking.LockContention

Locking modes.
Type:
Example
mysqlx.LockContention.DEFAULT
mysqlx.LockContention.NOWAIT
mysqlx.LockContention.SKIP_LOCKED

<static, constant> Mode :Query.DataModel

Database entity types.
Type:
Example
mysqlx.Mode.TABLE
mysqlx.Mode.DOCUMENT

<static, constant> Schema

Schema validation.
Properties:
Name Type Description
ValidationLevel module:Schema.ValidationLevel
Example
mysqlx.Schema.ValidationLevel.OFF
mysqlx.Schema.ValidationLevel.STRICT

Methods


<static> expr(value [, options])

Parse an expression string into a Mysqlx.Expr.Expr.
Parameters:
Name Type Argument Description
value string expression string
options module:mysqlx~ParserOptions <optional>
additional options
Returns:
The protobuf object version.
Type
proto.Mysqlx.Expr.Expr

<static> getClient(connection [, options])

Create a new X DevAPI connection pool.
Parameters:
Name Type Argument Description
connection string | module:Connection~Properties a connection string (URI) or a set of connection properties
options module:Client~Properties <optional>
extended client options
Returns:
Type
module:Client
Example
const client = mysqlx.getClient({ user: 'root' }, { pooling: { enabled: true, maxSize: 3 } })

client.getSession()
  .then(session => {
    console.log(session.inspect()); // { host: 'localhost', port: 33060, user: 'root', pooling: true, ... }
  })

<static> getSession(connection)

Create an X DevAPI session using a standalone connection.
Parameters:
Name Type Description
connection string | module:Connection~Properties a connection string (URI) or a set of connection properties
Returns:
Type
Promise.<module:Session>
Example
mysqlx.getSession({ user: 'root' })
  .then(session => {
    console.log(session.inspect()); // { host: 'localhost', port: 33060, user: 'root', pooling: false, ... }
  })

<static> getVersion()

Retrieve the connector version number (from package.json).
Returns:
Type
string

Type Definitions


ParserOptions

Additional parser options.
Type:
  • Object
Properties:
Name Type Argument Description
mode module:mysqlx~Mode <optional>
the parsing mode