# Orchid ORM > Postgres ORM & Query Builder ## Table of Contents - [Overview](/guide.md): Orchid ORM overview, features, philosophy, and comparison with other database tools for Node.js and TypeScript. - [Quickstart](/guide/quickstart.md): Quickstart guide for scaffolding Orchid ORM with project setup, package.json configuration, and tooling options. - [Current status and limitations](/guide/current-status-and-limitations.md): Current project status, limitations, supported features, and known constraints. ### ORM and query builder - [Advanced query methods](/guide/advanced-queries.md): Advanced query methods including CTEs (with, withRecursive, withSql), union operations, getColumnInfo, and copyTableData. - [Test factories](/guide/test-factories.md): Test factories for generating mock data using faker.js for testing with Orchid ORM tables. - [Error handling](/guide/error-handling.md): Error handling with OrchidOrmError, NotFoundError, QueryError, catch method, and catchUniqueError helper. #### Setup and Overview - [ORM setup](/guide/orm-setup.md): ORM and query builder setup, configuration options, databaseURL, logging, and connection settings. - [Table Factory](/guide/base-table.md): Creating and configuring a table factory with snakeCase, autoForeignKeys, nowSQL options, and custom column types. - [Define Tables](/guide/define-tables.md): Defining tables, table configuration options, and type inference helpers like Selectable, Insertable, Updatable. - [Views](/guide/views.md): Defining and querying PostgreSQL views with defineView, $views, relations, grants, refreshes, and generated migrations. - [Generate Migrations](/guide/generate-migrations.md): Automatic migration generation, role management, grants, default privileges, and generatorIgnore configuration. - [ORM Methods](/guide/orm-methods.md): ORM methods prefixed with $ including $query, $queryArrays, $prepare, $withOptions, $getAdapter, $from, and $close. - [Customize db adapter](/guide/customize-db-adapter.md): Customizing the database adapter with orchidORMWithAdapter for manual adapter instantiation. - [Standalone query builder](/guide/query-builder-standalone.md): Using the pqb query builder as a standalone tool without the full ORM. #### Features - [Computed columns](/guide/computed-columns.md): Computed columns with SQL-based computation, JavaScript runtime computed values, and async batch computed columns. - [Lifecycle hooks](/guide/hooks.md): Lifecycle hooks for create, update, delete operations with before/after hooks and after-commit functionality. - [Scopes](/guide/scopes.md): Query scopes including default scopes, custom scopes, scope method, and unscope functionality. - [Soft Delete](/guide/soft-delete.md): Soft delete functionality using deletedAt timestamp with includeDeleted and hardDelete methods. - [Repository](/guide/repo.md): Repository pattern for decomposing complex queries into reusable, chainable custom query methods. - [Full text search](/guide/text-search.md): Full text search with tsvector columns, search queries, ranking, and highlighted text selection. - [Row Level Security](/guide/row-level-security.md): Row Level Security status, setup fundamentals, and Orchid-supported RLS-related features. #### Query Builder - [Query methods](/guide/query-methods.md): Query methods including take, find, findBy, select, and handling NotFoundError for record retrieval. - [Where conditions](/guide/where.md): Where conditions, column operators, sub-queries, and complex filtering logic. - [Join](/guide/join.md): Joining tables and selecting relations with join, leftJoin, and relation selection methods. - [Create records](/guide/create.md): Creating records with accepted values, sub-queries, selecting related data, upsert, and conflict handling. - [Update records](/guide/update.md): Updating records with set values, sub-queries, updateFrom, and increment/decrement operations. - [Delete records](/guide/delete.md): Deleting records with conditions, returning columns, and using with expressions. - [Transactions](/guide/transactions.md): Database transactions with $transaction, nested transactions, ensureTransaction, isInTransaction, and testTransaction. - [SQL expressions](/guide/sql-expressions.md): SQL expressions with sql tagged template, sql.ref, column references, and arbitrary function calls with fn. - [Aggregate functions](/guide/aggregate.md): Aggregate functions for queries including count, min, max, sum, avg, jsonAgg, stringAgg, and custom aggregates. - [JSON functions](/guide/json.md): JSON operations including jsonPathQueryFirst, jsonSet, jsonReplace, jsonInsert, and jsonRemove functions. - [Window functions](/guide/window.md): Window functions including rowNumber, rank, denseRank, percentRank, and cumeDist with partitioning and ordering. #### Columns - [Columns schema overview](/guide/columns-overview.md): Column schema overview, custom column types, overriding parsing and encoding, and validation configuration. - [Common column methods](/guide/common-column-methods.md): Common column methods including primaryKey, default, nullable, identity, readOnly, setOnCreate, setOnUpdate, selectSql, and select configuration. - [Validation methods of columns](/guide/columns-validation-methods.md): Column validation methods with Zod and Valibot integration, validation rules for numeric, text, and array columns. - [Column types](/guide/columns-types.md): Complete reference of Postgres column types including numeric, text, date/time, JSON, geometry, network addresses, arrays, and more. ### Relations - [Relations](/guide/relations.md): Defining table relations including belongsTo, hasOne, hasMany, hasAndBelongsToMany with and without through. - [Relation queries](/guide/relation-queries.md): Relation queries with queryRelated, chain, and nested create, update, delete operations. ### Migrations - [Migrations setup and overview](/guide/migration-setup-and-overview.md): Migration setup, overview, and configuration for managing database schema evolution with TypeScript. - [Programmatic use of migrations](/guide/migration-programmatic-use.md): Programmatic use of migrations including creating databases, schemas, tables, and running migrations programmatically. - [Migration commands](/guide/migration-commands.md): Migration CLI commands for creating and dropping databases, pulling schema, and managing migration files. - [migration column methods](/guide/migration-column-methods.md): Migration column methods for default, nullable, enum, generated columns, primaryKey, indexes, foreign keys, and constraints. - [Writing a migration](/guide/migration-writing.md): Writing migrations with the change function, creating and dropping tables, columns, enums, and schemas. ### Other - [Migrate to the new table design](/guide/migrate-to-new-table-design.md): Migrate Orchid ORM tables and views from class-based createBaseTable definitions to function-style createTableFactory definitions.