Table Naming Convention
mostyn at platformis.net
Mon Jan 2 14:24:32 UTC 2023
I should add that there is no technical superiority in doing all this. But it does make programming life a lot easier because:
- related tables are grouped together in the developers UI
so its easier to find related tables
- when it comes to query classes (and sql joins in general) there will be no ambiguous columns
fewer sql errors
You should prefix your query classes with q or qy to distinguish them from schema and table classes classes.
You can use the Omnis UI to drag specific columns from schema classes to your query classes.
We don’t actually use query classes but plenty of people do.
> On 2 Jan 2023, at 07:09, Martin Obongita via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
> Hi all,
> I know that this topic has been discussed over and over in other forums.
> I have searched the archives and I didn't find this topic discussed.
> Most of the applications I have seen, I notice that the table column names are prefixed.
> A student table named "student" will have the columns studentID, studentName etc
> I guess this is helpful when working with queries.
> On the other hand in my Postgresql db, I prefix my tables in categories.
> System setting tables will begin with "z" eg "z1_setup", "z2_parameter" etc
> The columns will be named z1_id, z1_datatype, z1_columndefault, z3_defaultpassword, z3_passwordlength,z3_passwordminchar
> This will help when I create views and materialized views.
> I will simply concatenate two table names using their prefixes.
> This makes my work very easy when referencing columns.
> My question is, What is the best practice in naming table columns and running SQL statements with Omnis query classes?
> Best regardsMartin Obongita.
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en