createTable method
Creates the table in the MySQL database.
Generates and executes a CREATE TABLE SQL statement based on the table
definition. The SQL is generated using the table's toSQL()
method.
Parameters:
conn
- The active MySQL database connection
Returns a MySqlResult indicating the success or failure of the table creation operation.
Example:
var result = await table.createTable(conn);
if (result.success) {
print('Table created successfully');
}
Implementation
Future<MySqlResult> createTable(MySQLConnection conn) async {
String sql = toSQL();
return execute(conn, sql);
}