Updates
This commit is contained in:
Vendored
+4
-1
@@ -3,7 +3,7 @@ import schemaCondition from "./schema-condition";
|
||||
export default async function getTableColumns({ tableName, config, }) {
|
||||
const schemaCond = schemaCondition(config);
|
||||
const rows = await querySchemaRows({
|
||||
query: `SELECT COLUMN_NAME, COLUMN_TYPE, COLUMN_COMMENT FROM information_schema.COLUMNS WHERE ${schemaCond.where} AND TABLE_NAME = ? ORDER BY ORDINAL_POSITION`,
|
||||
query: `SELECT COLUMN_NAME, COLUMN_TYPE, COLUMN_COMMENT, IS_NULLABLE, COLUMN_DEFAULT, EXTRA FROM information_schema.COLUMNS WHERE ${schemaCond.where} AND TABLE_NAME = ? ORDER BY ORDINAL_POSITION`,
|
||||
values: [...schemaCond.values, tableName],
|
||||
config,
|
||||
});
|
||||
@@ -11,5 +11,8 @@ export default async function getTableColumns({ tableName, config, }) {
|
||||
name: row.COLUMN_NAME,
|
||||
type: row.COLUMN_TYPE,
|
||||
comment: row.COLUMN_COMMENT,
|
||||
isNullable: String(row.IS_NULLABLE).toUpperCase() === "YES",
|
||||
columnDefault: row.COLUMN_DEFAULT,
|
||||
extra: row.EXTRA || "",
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user