From fc8f0e53c85b27337c2f16b5d17f6381b953e544 Mon Sep 17 00:00:00 2001 From: clinyong Date: Wed, 26 Aug 2015 18:15:58 +0800 Subject: [PATCH] add toc to documentation --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/README.md b/README.md index 14b041e0..0d4fcbc4 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,61 @@ go get -u github.com/jinzhu/gorm installing the package by using the GoDoc page at: http://godoc.org/github.com/jinzhu/gorm +## Table of Contents + +- [Define Models (Structs)](#define-models-structs) +- [Conventions](#conventions) +- [Initialize Database](#initialize-database) +- [Migration](#migration) +- [Basic CRUD](#basic-crud) + - [Create Record](#create-record) + - [Query](#query) + - [Query With Where (Plain SQL)](#query-with-where-plain-sql) + - [Query With Where (Struct & Map)](#query-with-where-struct--map) + - [Query With Not](#query-with-not) + - [Query With Inline Condition](#query-with-inline-condition) + - [Query With Or](#query-with-or) + - [Query Chains](#query-chains) + - [Preloading (Eager loading)](#preloading-eager-loading) +- [Update](#update) + - [Update Without Callbacks](#update-without-callbacks) + - [Batch Updates](#batch-updates) + - [Update with SQL Expression](#update-with-sql-expression) +- [Delete](#delete) + - [Batch Delete](#batch-delete) + - [Soft Delete](#soft-delete) +- [Associations](#associations) + - [Has One](#has-one) + - [Belongs To](#belongs-to) + - [Has Many](#has-many) + - [Many To Many](#many-to-many) + - [Polymorphism](#polymorphism) +- [Advanced Usage](#advanced-usage) + - [FirstOrInit](#firstorinit) + - [FirstOrCreate](#firstorcreate) + - [Select](#select) + - [Order](#order) + - [Limit](#limit) + - [Offset](#offset) + - [Count](#count) + - [Pluck](#pluck) + - [Raw SQL](#raw-sql) + - [Row & Rows](#row--rows) + - [Scan](#scan) + - [Group & Having](#group--having) + - [Joins](#joins) + - [Transactions](#transactions) + - [Scopes](#scopes) + - [Callbacks](#callbacks) + - [Specifying The Table Name](#specifying-the-table-name) + - [Error Handling](#error-handling) + - [Logger](#logger) + - [Existing Schema](#existing-schema) + - [Composite Primary Key](#composite-primary-key) + - [Database Indexes & Foreign Key](#database-indexes--foreign-key) + - [Default values](#default-values) + - [More examples with query chain](#more-examples-with-query-chain) + ## Define Models (Structs) ```go