📋
GoSQL
  • GoSQL
  • Conventions
  • Basic Usage
    • Select Queries
    • Insert
    • Update
    • Delete
  • Advanced Usage
Powered by GitBook
On this page
  • Tables
  • Columns

Was this helpful?

Conventions

GoSQL is very opinionated.

Tables

Table names are all snake case of the struct name and singular. type User struct{} will correspond to the table in the database named user. type UserProfile struct{} will correspond to the table in the database named user_profile.

Columns

Column names are all snake case of the struct field names. Consider the struct:

type User struct {
    ID       int `gosql:"primary"`
    Email    string
    IsActive bool
}

GoSQL expects the database to have a table named user with 3 columns: id, email, and is_active.

PreviousGoSQLNextBasic Usage

Last updated 5 years ago

Was this helpful?