TiDB (Titanium DB)
Published 16 November 2022
TiDB (Titanium DB)
- Verified Versions: 5.0
- Maintainer: Community
Supported Versions and Support Levels
- For information regarding the supported version and support levels available, please see Supported Databases for Flyway
- For information regarding the Flyway features available, please see Flyway feature summary
Driver
Item | Details |
---|---|
URL format | jdbc:mysql://host:port/database |
SSL support | Not tested |
Ships with Flyway Command-line | Yes |
Maven Central coordinates | mysql:mysql-connector-java |
Supported versions | 5.0 and later |
Default Java class | com.mysql.jdbc.Driver |
Java Usage
YugabyteDB support is a separate dependency for Flyway and will need to be added to your Java project to access these features.
Maven
Open Source
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-tidb</artifactId>
</dependency>
Gradle
Open Source
dependencies {
compile "org.flywaydb:flyway-database-tidb"
}
SQL Script Syntax
- Standard SQL syntax with statement delimiter ;
- MySQL-style single-line comments (# Comment)
Example
/* Single line comment */
CREATE TABLE test_data (
value VARCHAR(25) NOT NULL,
PRIMARY KEY(value)
);
/*
Multi-line
comment
*/
-- MySQL procedure
DELIMITER //
CREATE PROCEDURE AddData()
BEGIN
# MySQL-style single line comment
INSERT INTO test_data (value) VALUES ('Hello');
END //
DELIMITER;
CALL AddData();
-- Placeholder
INSERT INTO ${tableName} (name) VALUES ('Mr. T');