Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.
This repository was archived by the owner on Jun 10, 2025. It is now read-only.

Aliases on column names #137

Description

@dsavina

In some cases, it could be practical to be able to alias columns names. For example, I've seen a project where the client required for the database to be in French. It would be very cool if the PHP code generated by TDBM could despite that be in English (names of the getters/setters and json serialization), using a per-column english translation as an alias.

I see that TDBM tries to match @defaultSort desc/asc in the columns comments to define a default sort column on a table (by the way, wouldn't it be preferable to look for order in the comment of the table itself? If several columns have this annotation, only the last one will be taken into account) ; similarly, we could specify an annotation @alias <alias>.

More generally, this little piece of code using columns comments to define a default sort column broke my mind: so many cool things to do using annotations in the comments of the database.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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