FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.26k stars 217 forks source link

Provide package or other built-in means to obtain DDL for database objects #7584

Open mrotteveel opened 1 year ago

mrotteveel commented 1 year ago

Currently, Firebird itself has no means to "reverse engineer" the DDL of database objects. This responsibility is shifted to client tools like ISQL and third-party query tools. I think it would make sense for Firebird itself to be able to generate the necessary DDL, so third party tools and users can query this information directly from the server, instead of having to implement the necessary reverse engineering themselves.

I think a built-in package with function(s) and/or procedure(s) to do this would make sense, e.g. call it RDB$METADATA (which is generic enough that it can also house other metadata related functions in the future). As a rough sketch, I think it could provide the following functions (I think functions make more sense than procedures for this):

aafemt commented 1 year ago

If provide a package, consider interface compatible with Oracle DBMS_METADATA.

mrotteveel commented 1 year ago

If provide a package, consider interface compatible with Oracle DBMS_METADATA.

I see no point in doing that. That Oracle package has an extremely complex API.

aafemt commented 1 year ago

Yes, it may be complicated but flexible to allow to get many DDLs at once. The package also provides shortcut GET_DDL for simple returning of a single object. More important that it is an established API that users got used to.

mrotteveel commented 1 year ago

I don't think there is much overlap between Oracle and Firebird users, so I don't think that argument makes sense.