Skip to content

Commit

Permalink
Merge branch '5.1' into 5
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 9, 2024
2 parents 980c4b9 + d01a1eb commit 368339c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion en/02_Developer_Guides/00_Model/08_SQL_Select.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ While you could hardcode table names into your SQL queries, that invites human e
- [`classHasTable()`](api:SilverStripe\ORM\DataObjectSchema::classHasTable()): Check if there is a table in the database for a given `DataObject` class (i.e. whether that class defines columns not already present in another class further up the class hierarchy)
- [`sqlColumnForField()`](api:SilverStripe\ORM\DataObjectSchema::sqlColumnForField()): Get the ANSI-quoted table and column name for a given `DataObject` field (in `"Table"."Field"` format)
- [`tableForField()`](api:SilverStripe\ORM\DataObjectSchema::tableForField()): Get the table name in the class hierarchy which contains a given field column.
- [`tableName()`](api:SilverStripe\ORM\DataObjectSchema::tableName()): Get table name for the given class. Note that this does not confirm a table actually exists (or should exist), but returns the name that would be used if this table did exist. Male sure to call `classHasTable()` before using this table name in a query.
- [`tableName()`](api:SilverStripe\ORM\DataObjectSchema::tableName()): Get table name for the given class. Note that this does not confirm a table actually exists (or should exist), but returns the name that would be used if this table did exist. Make sure to call `classHasTable()` before using this table name in a query.

[hint]
While the default database connector will work fine without explicitly ANSI-quoting table names in queries, it is good practice to make sure they are quoted (especially if you're writing these queries in a module that will be publicly shared) to ensure your queries will work on other database connectors such as [`PostgreSQLDatabase`](https://github.com/silverstripe/silverstripe-postgresql) which explicitly require ANSI quoted table names.
Expand Down

0 comments on commit 368339c

Please sign in to comment.