Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • T torque-postgresql
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Carlos
  • torque-postgresql
  • Wiki
  • Inherited Tables

Inherited Tables · Changes

Page history
Updated Inherited Tables (markdown) authored Sep 23, 2021 by Carlos's avatar Carlos
Hide whitespace changes
Inline Side-by-side
Inherited-Tables.md
View page @ ff85236d
...@@ -116,11 +116,13 @@ list.second # nil ...@@ -116,11 +116,13 @@ list.second # nil
list.third # nil list.third # nil
``` ```
#### Returning the records' type #### ~~Returning the records' type~~
In order to perform any query with correct performance and maintainability, this feature uses [Auxiliary Statements](https://github.com/crashtech/torque-postgresql/wiki/Auxiliary-Statements) and [Dynamic Attributes](https://github.com/crashtech/torque-postgresql/wiki/Dynamic-Attributes). > DEPRECATED: This is being replaced by a cast operation that translates the tableoid into its table name (AKA regclass), as in `"activities"."tableoid"::regclass`. This improvement removes the necessity of an auxiliary statement and an extra join in queries.
The `_record_class` (with can be renamed using the [`inheritance.record_class_column_name`](https://github.com/crashtech/torque-postgresql/wiki/Configuring#inheritance.record_class_column_name) setting) is used both as an Auxiliary Statement and a Dynamic Attribute to get the type of the records. While it's a great example of these provided features, you can always take advantage of this to get the type of the record. ~~In order to perform any query with correct performance and maintainability, this feature uses [Auxiliary Statements](https://github.com/crashtech/torque-postgresql/wiki/Auxiliary-Statements) and [Dynamic Attributes](https://github.com/crashtech/torque-postgresql/wiki/Dynamic-Attributes).~~
The `_record_class` method (which can be renamed using the [`inheritance.record_class_column_name`](https://github.com/crashtech/torque-postgresql/wiki/Configuring#inheritance.record_class_column_name) setting) is used both as an Auxiliary Statement and a Dynamic Attribute to get the type of the records. While it's a great example of these provided features, you can always take advantage of this to get the type of the record.
```ruby ```ruby
list = Activity.all.with(:_record_class).load.to_a list = Activity.all.with(:_record_class).load.to_a
......
Clone repository
  • Wiki
  • Configuring

Core Extensions

  • Range (DEPRECATED)

Data types

  • Enum
  • Enum Set
  • Interval
  • Date/Time Range
  • Box
  • Circle
  • Line
  • Segment

Querying

  • Arel
  • Has Many
  • Belongs to Many
  • Dynamic Attributes
  • Distinct On
  • Insert All
  • Auxiliary Statements
  • Inherited Tables