Module: mysqlx

Members


<static, constant> IntegerType :module:Connection~IntegerType

Conversion mode for downstream integer values.
Type:
Example
mysqlx.IntegerType.BIGINT
mysqlx.IntegerType.STRING
mysqlx.IntegerType.UNSAFE_BIGINT
mysqlx.IntegerType.UNSAFE_STRING

<static, constant> LockContention :Locking.LockContention

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

<static, constant> Mode :DataModel

Data model that determines if an X DevAPI expression identifier corresponds to table column name or a document field name.
Type:
  • DataModel
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

<inner, readonly> DataModel :number

Enum that specifies the existing data model options.
Type:
  • number
Example
TABLE
DOCUMENT

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 options to configure the X DevAPI expression parser.
Type:
  • Object
Properties:
Name Type Argument Description
mode module:mysqlx~DataModel <optional>
Data model that determines specific parsing rules that apply to document fields or column identifiers.