Merge branch 'master' into develop

This commit is contained in:
SPRINX0\prochazka
2024-07-25 11:06:43 +02:00
9 changed files with 736 additions and 6 deletions

View File

@@ -55,8 +55,8 @@ class Analyser extends DatabaseAnalyser {
super(pool, driver, version);
}
createQuery(resFileName, typeFields) {
const query = super.createQuery(sql[resFileName], typeFields);
createQuery(resFileName, typeFields, replacements = {}) {
const query = super.createQuery(sql[resFileName], typeFields, replacements);
return query;
}
@@ -138,7 +138,10 @@ class Analyser extends DatabaseAnalyser {
: null;
this.feedback({ analysingMessage: 'Loading routines' });
const routines = await this.analyserQuery('routines', ['procedures', 'functions']);
const routines = await this.analyserQuery('routines', ['procedures', 'functions'], {
$typeAggFunc: this.driver.dialect.stringAgg ? 'string_agg' : 'max',
$typeAggParam: this.driver.dialect.stringAgg ? ", '|'" : '',
});
this.feedback({ analysingMessage: 'Loading indexes' });
const indexes = this.driver.__analyserInternals.skipIndexes

View File

@@ -11,6 +11,7 @@ where
table_constraints.table_schema <> 'information_schema'
and table_constraints.table_schema <> 'pg_catalog'
and table_constraints.table_schema !~ '^pg_toast'
and table_constraints.table_schema !~ '^_timescaledb_'
and table_constraints.constraint_type = 'PRIMARY KEY'
and ('tables:' || table_constraints.table_schema || '.' || table_constraints.table_name) =OBJECT_ID_CONDITION
order by key_column_usage.ordinal_position

View File

@@ -5,7 +5,7 @@ select
max(routine_definition) as "definition",
max(md5(routine_definition)) as "hash_code",
routine_type as "object_type",
string_agg(data_type, '|') as "data_type",
$typeAggFunc(data_type $typeAggParam) as "data_type",
max(external_language) as "language"
from
information_schema.routines where routine_schema != 'information_schema' and routine_schema != 'pg_catalog' and routine_schema !~ '^_timescaledb_'

View File

@@ -99,6 +99,19 @@ const dialect = {
],
};
}
if (dataType?.toLowerCase() == 'uuid') {
return {
exprType: 'unaryRaw',
expr: {
exprType: 'column',
alias: alias || columnName,
source,
columnName,
},
afterSql: '::text',
};
}
},
};