Skip to content

Improvement: Allow inline comments for fields, procedure parameters, and more... #8780

@sim1984

Description

@sim1984

MySQL allows you to leave comments in place for table fields, as well as procedure and function parameters.

For example, for a table, it looks like this:

CREATE TABLE IF NOT EXISTS `mwr_essence`
(
    `CODE_ESSENCE`  int         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `CODE_GESSENCE` int         NOT NULL COMMENT 'Object type ID',
    `NAME`          varchar(50) NOT NULL COMMENT 'Security object name',
    PRIMARY KEY (`CODE_ESSENCE`),
    UNIQUE KEY `UNQ_ESSENCE` (`NAME`),
    KEY `FK_ESSENCE_GESSENCE` (`CODE_GESSENCE`)
) ENGINE = InnoDB
    COMMENT = 'Security objects'
  AUTO_INCREMENT = 1;

Example for a stored procedure and its parameters:

CREATE PROCEDURE SP_MW_GRANT_ROLE(
    IN A_MASTERROLE VARCHAR(50) COMMENT 'Master role name',
    IN A_DETAILROLE VARCHAR(50) COMMENT 'Detail role name',
    IN A_VALID INTEGER COMMENT 'If 1 then detail role is active, else is not active'
)
    SQL SECURITY INVOKER
    COMMENT 'Set role to another role'
BEGIN
/* ... */
END

Whereas in our case, descriptions of objects, table fields, and procedure parameters are created only separately using the COMMENT ON statement, which is usually located quite far from the column, parameter, or package procedure/function being described. It would be great to be able to leave in-place comments in Firebird as well. This would make metadata creation scripts clearer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions