Skip to content

bsm/minisql

Repository files navigation

MiniSQL

Go Reference Test License

A minimal SQL query builder for Go.

Usage

func GetUserName(ctx context.Context, db *sql.DB, userID int64) (string, error) {
  query := minisql.Pooled()
  defer minisql.Release(query)

  query.AppendString(`SELECT user.name FROM users WHERE id = `)
  query.AppendValue(userID)

  var name string
  err := query.QueryRowContext(ctx, db).Scan(&name)
  return name, err
}

Documentation

Please see the API documentation for package and API descriptions and examples.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published