Posts · Page 6

4 min read

Implement an ORM Framework in Go - GeeORM Day 5 Implementing Hooks

7 days to implement the ORM framework GeeORM in Go/golang from scratch tutorial (7 days implement golang object relational mapping framework from scratch tutorial), write an ORM framework by hand, modeled after gorm and xorm. Use reflection (reflect) to obtain the hooks (hooks) bound to a struct and invoke them; support calling hooks before and after CRUD (create, read, update, delete) operations.

6 min read

Implement an ORM Framework in Go - GeeORM Day 4 Chain Operations, Update and Delete

7 days to implement the ORM framework GeeORM in Go/golang from scratch tutorial (7 days implement golang object relational mapping framework from scratch tutorial), write an ORM framework by hand, modeled after gorm and xorm. Support stacking query conditions (where, order by, limit, etc.) through chained (chain) operations; implement updating (update), deleting (delete) and counting (count) records.

7 min read

Implement an ORM Framework in Go - GeeORM Day 3 Record Operations

7 days to implement the ORM framework GeeORM in Go/golang from scratch tutorial (7 days implement golang object relational mapping framework from scratch tutorial), write an ORM framework by hand, modeled after gorm and xorm. Implement inserting (insert) records; use reflection (reflect) to convert database records into the corresponding struct instances, implementing the query (select) feature.

9 min read

Implement an ORM Framework in Go - GeeORM Day 2 Mapping Structs to Tables

A tutorial on implementing the ORM framework GeeORM in Go/golang from scratch in 7 days (7 days implement golang object relational mapping framework from scratch tutorial). Build an ORM framework by hand, modeled after gorm and xorm. This article uses reflection (reflect) to obtain the name and fields of an arbitrary struct object and map it to a table in the database; uses dialect to isolate the differences between databases for easy extension; and creates and drops database tables.

10 min read

Implement an ORM Framework in Go - GeeORM Day 1 database/sql Basics

A tutorial on implementing the ORM framework GeeORM in Go/golang from scratch in 7 days (7 days implement golang object relational mapping framework from scratch tutorial). Build an ORM framework by hand, modeled after gorm and xorm. This article introduces basic SQLite operations (connecting to the database, creating tables, inserting and deleting records, etc.) and using the Go standard library database/sql to work with SQLite, including Exec, Query and QueryRow.

5 min read

Implement an ORM Framework in Go from Scratch in 7 Days - GeeORM

A tutorial on implementing the ORM framework GeeORM in Go/golang from scratch in 7 days (7 days implement golang object relational mapping framework from scratch tutorial). Build an ORM framework by hand, modeled after gorm and xorm. Features include two-way mapping between objects and table schemas, creating and dropping tables, CRUD operations on records, transaction support, database migration (migrate), hooks, and more.