Categorygithub.com/ddliu/go-dbless
modulepackage
0.3.3
Repository: https://github.com/ddliu/go-dbless.git
Documentation: pkg.go.dev

# README

go-dbless

Travis godoc License Go Report Card cover.run

Database library with less complexity and less modeling.

Install

go get -u github.com/ddliu/go-dbless

Usage

import (
    "github.com/ddliu/go-dbless"
    _ "github.com/ddliu/go-dbless/driver/mysql"
    _ "github.com/go-sql-driver/mysql"
)
db := dbless.Open("mysql", "dsn")

Basic

  • Insert
  • Update
  • Delete
  • GetRows
  • GetRow
  • Scalar

Schema

  • List databases
  • List tables
  • List columns

Resource

package main
import github.com/ddliu/go-dbless

func main() {
    db := somedb()

    resource := dbless.Resource{
        Name: "user",
        Timestamp: true,
        DB: db,
    }

    id, err := resource.Save(dbless.Record{
        "username": "ddliu",
        "password": "123456",
    })

    user, err := record.Get(id)

    listing := resource.List(dbless.ListInput{
        Pagination: dbless.Pagination {
            PageSize: 20,
            Page: 1,
        },
    })
}

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author