Rules and naming conventions

Build 1501 on 14/Nov/2017  This topic last edited on: 6/Aug/2014, at 16:23

Database table and column names must follow certain rules: do not exceed a maximum length, avoid certain characters, avoid ‘special’ names, etc. These rules depend on the database engine used. To be compatible with as many different database engines as possible GN4 follows a series of rules and naming conventions:

All table and column names are generated using either the prefix ‘gn_’ or ‘s_’ – this avoids clashes with database pre-defined names and reserved words.

All database identifiers (table, column and index names) do not exceed 28 characters in length – that is the shortest maximum length between all the common database engines (28 is Sybase, for Oracle is 30). Because of the prefix ‘s_’ , attribute and object type names cannot be longer than 26 characters

All database identifiers contain only letters, digits and the ‘_’ (underscore) character, and start with a letter. This means of course that these restrictions apply also to object type and attribute names.

Index names are generated using a unique hash of the name of the table and all of the columns in the index converted to a string containing only letters and digits and with a ‘i’ prefix. This guarantees that the index names are unique across the entire database (an Oracle requirement) and respect the name restrictions.