Skip to content

Support MariaDB default values for timestamp #4105

@critrun

Description

@critrun

What do you want to change?

If I create a table like for example:

CREATE TABLE IF NOT EXISTS `session` (
    `id` INT NOT NULL,
    `expiry` TIMESTAMP NOT NULL DEFAULT (CURRENT_TIMESTAMP + INTERVAL 30 DAY),
    PRIMARY KEY (`id`)
);

Currently this default for the expiry will not work as it causes syntax error, as this isn't a feature for mysql but only mariadb from my understanding. It would be nice to have these more programmatic defaults work with sqlc.

What database engines need to be changed?

MySQL

What programming language backends need to be changed?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions