mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 07:56:01 +00:00
postgre function analyser
This commit is contained in:
@@ -139,6 +139,7 @@ class Analyser extends DatabaseAnalyser {
|
||||
.filter(x => x.object_type == 'FUNCTION')
|
||||
.map(func => ({
|
||||
objectId: `functions:${func.schema_name}.${func.pure_name}`,
|
||||
createSql: `CREATE FUNCTION "${func.schema_name}"."${func.pure_name}"() RETURNS ${func.data_type} LANGUAGE ${func.language}\nAS\n$$\n${func.definition}\n$$`,
|
||||
pureName: func.pure_name,
|
||||
schemaName: func.schema_name,
|
||||
contentHash: func.hash_code,
|
||||
|
||||
@@ -5,6 +5,7 @@ select
|
||||
routine_definition as "definition",
|
||||
md5(routine_definition) as "hash_code",
|
||||
routine_type as "object_type",
|
||||
data_type as "data_type",
|
||||
external_language as "language"
|
||||
from
|
||||
information_schema.routines where routine_schema != 'information_schema' and routine_schema != 'pg_catalog'
|
||||
|
||||
Reference in New Issue
Block a user