⭐️ If you like MikroORM, give it a star on GitHub and consider sponsoring its development! ⭐️
This is documentation for an unreleased version. For the latest API, see version 6.4.
Version: Next
quote
Callable
quote(expParts, ...values): any
Tag function providing quoting of db identifiers (table name, columns names, index names, ...).
Within the template literal on which the tag function is applied, all placeholders are considered to be database identifiers, and will thus be quoted as so according to the database in use.
// On postgres, will produce: create index "index custom_idx_on_name" on "library.author" ("name") // On mysql, will produce: create index `index custom_idx_on_name` on `library.author` (`name`) @Index({ name:'custom_idx_on_name',expression:(table, columns)=> quote`create index ${'custom_idx_on_name'} on ${table} (${columns.name})`}) @Entity({ schema:'library'}) exportclassAuthor{...}
Tag function providing quoting of db identifiers (table name, columns names, index names, ...).
Within the template literal on which the tag function is applied, all placeholders are considered to be database identifiers, and will thus be quoted as so according to the database in use.