Skip to content

Sql Generator

Antonia Elek edited this page Aug 13, 2019 · 1 revision

Sql Generator enables generation of sql queries (CREATE, UPDATE, INSERT, DELETE) for M-Files classes. These queries can be used in M-Files to setup object connection to external database.

Application uses a set of rules and settings defined in json configuration file to establish connection to an M-Files vault and to normalize class and property names in generated SQL queries.

Configuration

Configuration file defines connection to an M-Files vault and name normalization rules and it consists of the following three elements:

  • Vault defines M-Files connection parameters
  • ItemNameTransform defines how item name will be transformed in generated queries.
  • IgnoreBuiltinProperties instructs generator to include or skip built-in class properties when generating queries.

Below is an example configuration file.

{
  "Vault": {
    "VaultName": "Sample Vault",
    "LoginType": "MFiles",
    "Username": "test",
    "Password": "test"
  },
  "ItemNameTransform": {
    "RemoveNonAlphaNumericChars": true,
    "RemoveWhiteSpace": true,
    "RemoveAccents": true,
    "Casing": "PascalCase"
  },
  "IgnoreBuiltinProperties": true
}

Each of the three configuration parts and their properties are further explained below.

Vault

Configuration part that defines connection to M-Files vault.

Property Type Required Default Value
VaultName string Yes
LoginType one of:
MFiles
Windows
Yes MFiles
Domain string No
Username string No
Password string No
Protocol one of:
TcpIp
LocalProcedureCall
Spx
Https
No TcpIp
NetworkAddress string No localhost
Port int No 2266
LocalComputerName string No
EncryptedConnection bool No No

ItemNameTransform

Configuration part that defines how the class and property names will be transformed in generated queries.

Property Type Required
RemoveNonAlphaNumericChars bool Yes
RemoveWhiteSpace bool Yes
RemoveAccents bool Yes
Casing one of:
Original
UpperCase
LowerCase
PascalCase
CamelCase
HypenCase
SnakeCase
Yes

IgnoreBuiltinProperties

If set to true, built-in class properties will be included in generated queries, if set to false these properties will be skipped.