From 660520b93922ff295759d147e2d6f9c7d37e15ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 21 Nov 2016 20:35:05 +0100 Subject: [PATCH] Documentation --- README.md | 102 +++++++++++++++++++++++++++--------------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 69185e635..96623f4c9 100644 --- a/README.md +++ b/README.md @@ -1639,7 +1639,6 @@ Your custom structs and classes can adopt each protocol individually, and opt in **Protocols and the Record class** -- **[List of Record Methods](#list-of-record-methods)** - [RowConvertible Protocol](#rowconvertible-protocol) - [TableMapping Protocol](#tablemapping-protocol) - [Persistable Protocol](#persistable-protocol) @@ -1649,6 +1648,7 @@ Your custom structs and classes can adopt each protocol individually, and opt in - [Record Class](#record-class) - [Changes Tracking](#changes-tracking) - [The Implicit RowID Primary Key](#the-implicit-rowid-primary-key) +- **[List of Record Methods](#list-of-record-methods)** ### Inserting Records @@ -1755,56 +1755,6 @@ You can now jump to: - [The Query Interface](#the-query-interface) -## List of Record Methods - -This is the list of record methods, along with their required protocols. The [Record Class](#record-class) adopts all these protocols. - -| Method | Protocols | Info | -| ------ | --------- | ---- | -| **Inserting and Updating Records** | | | -| `try record.insert(db)` | [Persistable](#persistable-protocol) | | -| `try record.save(db)` | [Persistable](#persistable-protocol) | | -| `try record.update(db)` | [Persistable](#persistable-protocol) | | -| `try record.update(db, columns: ...)` | [Persistable](#persistable-protocol) | | -| **Checking Record Existence** | | | -| `record.exists(db)` | [Persistable](#persistable-protocol) | | -| **Deleting Records** | | | -| `try record.delete(db)` | [Persistable](#persistable-protocol) | | -| `try Type.deleteOne(db, key: ...)` | [TableMapping](#tablemapping-protocol) | Requires a unique key ¹ | -| `try Type.deleteAll(db)` | [TableMapping](#tablemapping-protocol) | | -| `try Type.deleteAll(db, keys: ...)` | [TableMapping](#tablemapping-protocol) | Requires unique keys ¹ | -| `try Type.filter(...).deleteAll(db)` | [TableMapping](#tablemapping-protocol) | See [fetch requests](#requests) | -| **Counting Records** | | | -| `Type.fetchCount(db)` | [TableMapping](#tablemapping-protocol) | | -| `Type.filter(...).fetchCount(db)` | [TableMapping](#tablemapping-protocol) | See [fetch requests](#requests) | -| **Fetching Record Sequences** | | | -| `Type.fetch(db)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | | -| `Type.fetch(db, keys: ...)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | Requires unique keys ¹ | -| `Type.fetch(db, sql)` | [RowConvertible](#rowconvertible-protocol) | | -| `Type.fetch(db, statement)` | [RowConvertible](#rowconvertible-protocol) | See [prepared statements](#prepared-statements) | -| `Type.fetch(db, request)` | [RowConvertible](#rowconvertible-protocol) | See [fetch requests](#requests) | -| `Type.filter(...).fetch(db)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | See [fetch requests](#requests) | -| **Fetching Record Arrays** | | | -| `Type.fetchAll(db)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | | -| `Type.fetchAll(db, keys: ...)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | Requires unique keys ¹ | -| `Type.fetchAll(db, sql)` | [RowConvertible](#rowconvertible-protocol) | | -| `Type.fetchAll(db, statement)` | [RowConvertible](#rowconvertible-protocol) | See [prepared statements](#prepared-statements) | -| `Type.fetchAll(db, request)` | [RowConvertible](#rowconvertible-protocol) | See [fetch requests](#requests) | -| `Type.filter(...).fetchAll(db)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | See [fetch requests](#requests) | -| **Fetching Individual Records** | | | -| `Type.fetchOne(db)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | | -| `Type.fetchOne(db, key: ...)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | Requires a unique key ¹ | -| `Type.fetchOne(db, sql)` | [RowConvertible](#rowconvertible-protocol) | | -| `Type.fetchOne(db, statement)` | [RowConvertible](#rowconvertible-protocol) | See [prepared statements](#prepared-statements) | -| `Type.fetchOne(db, request)` | [RowConvertible](#rowconvertible-protocol) | See [fetch requests](#requests) | -| `Type.filter(...).fetchOne(db)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | See [fetch requests](#requests) | -| **Changes Tracking** | | | -| `record.hasPersistentChangedValues` | [Record](#record-class) | | -| `record.persistentChangedValues` | [Record](#record-class) | | - -¹ Unique keys are primary keys (single-column, composite, [implicit RowID](#the-implicit-rowid-primary-key)) and unique indexes. - - ## RowConvertible Protocol **The RowConvertible protocol grants fetching methods to any type** that can be built from a database row: @@ -2435,6 +2385,56 @@ When SQLite won't let you provide an explicit primary key (as in [full-text](#fu ``` +## List of Record Methods + +This is the list of record methods, along with their required protocols. The [Record Class](#record-class) adopts all these protocols. + +| Method | Protocols | Info | +| ------ | --------- | ---- | +| **Inserting and Updating Records** | | | +| `try record.insert(db)` | [Persistable](#persistable-protocol) | | +| `try record.save(db)` | [Persistable](#persistable-protocol) | | +| `try record.update(db)` | [Persistable](#persistable-protocol) | | +| `try record.update(db, columns: ...)` | [Persistable](#persistable-protocol) | | +| **Checking Record Existence** | | | +| `record.exists(db)` | [Persistable](#persistable-protocol) | | +| **Deleting Records** | | | +| `try record.delete(db)` | [Persistable](#persistable-protocol) | | +| `try Type.deleteOne(db, key: ...)` | [TableMapping](#tablemapping-protocol) | Requires a unique key ¹ | +| `try Type.deleteAll(db)` | [TableMapping](#tablemapping-protocol) | | +| `try Type.deleteAll(db, keys: ...)` | [TableMapping](#tablemapping-protocol) | Requires unique keys ¹ | +| `try Type.filter(...).deleteAll(db)` | [TableMapping](#tablemapping-protocol) | See [fetch requests](#requests) | +| **Counting Records** | | | +| `Type.fetchCount(db)` | [TableMapping](#tablemapping-protocol) | | +| `Type.filter(...).fetchCount(db)` | [TableMapping](#tablemapping-protocol) | See [fetch requests](#requests) | +| **Fetching Record Sequences** | | | +| `Type.fetch(db)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | | +| `Type.fetch(db, keys: ...)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | Requires unique keys ¹ | +| `Type.fetch(db, sql)` | [RowConvertible](#rowconvertible-protocol) | | +| `Type.fetch(db, statement)` | [RowConvertible](#rowconvertible-protocol) | See [prepared statements](#prepared-statements) | +| `Type.fetch(db, request)` | [RowConvertible](#rowconvertible-protocol) | See [fetch requests](#requests) | +| `Type.filter(...).fetch(db)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | See [fetch requests](#requests) | +| **Fetching Record Arrays** | | | +| `Type.fetchAll(db)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | | +| `Type.fetchAll(db, keys: ...)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | Requires unique keys ¹ | +| `Type.fetchAll(db, sql)` | [RowConvertible](#rowconvertible-protocol) | | +| `Type.fetchAll(db, statement)` | [RowConvertible](#rowconvertible-protocol) | See [prepared statements](#prepared-statements) | +| `Type.fetchAll(db, request)` | [RowConvertible](#rowconvertible-protocol) | See [fetch requests](#requests) | +| `Type.filter(...).fetchAll(db)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | See [fetch requests](#requests) | +| **Fetching Individual Records** | | | +| `Type.fetchOne(db)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | | +| `Type.fetchOne(db, key: ...)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | Requires a unique key ¹ | +| `Type.fetchOne(db, sql)` | [RowConvertible](#rowconvertible-protocol) | | +| `Type.fetchOne(db, statement)` | [RowConvertible](#rowconvertible-protocol) | See [prepared statements](#prepared-statements) | +| `Type.fetchOne(db, request)` | [RowConvertible](#rowconvertible-protocol) | See [fetch requests](#requests) | +| `Type.filter(...).fetchOne(db)` | [RowConvertible](#rowconvertible-protocol) & [TableMapping](#tablemapping-protocol) | See [fetch requests](#requests) | +| **Changes Tracking** | | | +| `record.hasPersistentChangedValues` | [Record](#record-class) | | +| `record.persistentChangedValues` | [Record](#record-class) | | + +¹ Unique keys are primary keys (single-column, composite, [implicit RowID](#the-implicit-rowid-primary-key)) and unique indexes. + + The Query Interface ===================