Documentation Home
X DevAPI User Guide
Download this Manual
PDF (US Ltr) - 1.4Mb
PDF (A4) - 1.4Mb


X DevAPI User Guide

Abstract

User documentation for developers using X DevAPI.

For legal information, see the Legal Notices.

For help with using MySQL, please visit the MySQL Forums, where you can discuss your issues with other MySQL users.

Document generated on: 2024-03-18 (revision: 78098)

Table of Contents

Preface and Legal Notices
1 Overview
2 Connection and Session Concepts
2.1 Database Connection Example
2.2 Connecting to a Session
2.2.1 Connecting to a Single MySQL Server
2.2.2 Connecting to One of Multiple Hosts and Connection Failover
2.2.3 Connecting to a Single MySQL Server Using Connection Pooling
2.2.4 Connections Using DNS SRV Records
2.2.5 Connection Option Summary
2.2.6 Connection Attributes
2.3 Working with a Session Object
2.4 Using SQL with Session
2.5 Setting the Current Schema
2.6 Dynamic SQL
3 CRUD Operations
3.1 CRUD Operations Overview
3.2 Method Chaining
3.3 Synchronous versus Asynchronous Execution
3.4 Parameter Binding
3.5 MySQL Shell Automatic Code Execution
4 Working with Collections
4.1 Basic CRUD Operations on Collections
4.2 Collection Objects
4.2.1 Creating a Collection
4.2.2 Working with Existing Collections
4.3 Collection CRUD Function Overview
4.3.1 Collection.add()
4.3.2 Collection.find()
4.3.3 Collection.modify()
4.3.4 Collection.remove()
4.4 Indexing Collections
4.5 Single Document Operations
4.6 JSON Schema Validation
5 Working with Documents
5.1 Creating Documents
5.2 Working with Document IDs
5.3 Understanding Document IDs
6 Working with Relational Tables
6.1 Syntax of the SQL CRUD Functions
7 Working with Relational Tables and Documents
7.1 Collections as Relational Tables
8 Statement Execution
8.1 Transaction Handling
8.1.1 Processing Warnings
8.1.2 Error Handling
8.2 Working with Savepoints
8.3 Working with Locking
8.4 Working with Prepared Statements
9 Working with Result Sets
9.1 Result Set Classes
9.2 Working with AUTO-INCREMENT Values
9.3 Working with Data Sets
9.4 Fetching All Data Items at Once
9.5 Working with SQL Result Sets
9.6 Working with Metadata
9.7 Support for Language Native Iterators
10 Building Expressions
10.1 Expression Strings
10.1.1 Boolean Expression Strings
10.1.2 Value Expression Strings
11 CRUD EBNF Definitions
11.1 Session Objects and Functions
11.2 Schema Objects and Functions
11.3 Collection CRUD Functions
11.4 Collection Index Management Functions
11.5 Table CRUD Functions
11.6 Result Functions
11.7 Other EBNF Definitions
12 Expressions EBNF Definitions
13 Implementation Notes
13.1 MySQL Connector Notes
13.2 MySQL Shell X DevAPI extensions
13.3 MySQL Connector/Node.js Notes
13.4 MySQL Connector/J Notes

List of Figures

2.1 Connection URI
3.1 Database Object - Class Diagram
6.1 Table.insert() Syntax Diagram
6.2 Table.select() Syntax Diagram
6.3 Table.update() Syntax Diagram
6.4 Table.delete() Syntax Diagram
9.1 Result Classes
11.1 Session
11.2 SqlExecute
11.3 SQLPlaceholderValues
11.4 SQLPlaceholderName
11.5 SQLLiteral
11.6 Schema
11.7 Collection
11.8 Table
11.9 CollectionFindFunction
11.10 CollectionModifyFunction
11.11 CollectionAddFunction
11.12 CollectionRemoveFunction
11.13 CollectionCreateIndexFunction
11.14 CollectionDropIndex
11.15 TableSelectFunction
11.16 TableInsertFunction
11.17 TableUpdateFunction
11.18 TableDeleteFunction
11.19 Result
11.20 DocResult
11.21 RowResult
11.22 Column
11.23 SqlResult
11.24 SearchConditionStr
11.25 SearchExprStrList
11.26 ProjectedDocumentExprStr
11.27 ProjectedSearchExprStrList
11.28 SortExprStrList
11.29 ExprOrLiteral
11.30 ExprOrLiterals
11.31 ExprOrLiteralOrOperand
11.32 PlaceholderValues
11.33 PlaceholderName
11.34 DocPath
11.35 Literal
11.36 Expression
11.37 Document
11.38 JSONExpression
11.39 JSONDocumentExpression
11.40 FunctionName
11.41 DocumentOrJSON
11.42 TableField
11.43 TableFields
12.1 ident
12.2 schemaQualifiedIdent
12.3 columnIdent
12.4 documentPathLastItem
12.5 documentPathItem
12.6 documentPath
12.7 documentField
12.8 argsList
12.9 lengthSpec
12.10 castType
12.11 functionCall
12.12 placeholder
12.13 groupedExpr
12.14 unaryOp
12.15 literal
12.16 jsonKeyValue
12.17 jsonDoc
12.18 jsonarray
12.19 atomicExpr
12.20 INTERVAL_UNIT
12.21 interval
12.22 intervalExpr
12.23 mulDivExpr
12.24 addSubExpr
12.25 shiftExpr
12.26 bitExpr
12.27 compExpr
12.28 ilriExpr
12.29 andExpr
12.30 orExpr
12.31 expr
12.32 DIGIT
12.33 FLOAT
12.34 INT
12.35 QUOTED_ID
12.36 ID
12.37 WS
12.38 SCHAR
12.39 STRING_DQ
12.40 STRING_SQ