sqlc-gen-zz

command module
v0.0.0-...-c069132 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2025 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

sqlc-gen-zz

sqlc plugin for zombiezen.com/go/sqlite

Quick Start

Install sqlc and plugin, then sqlc generate in a project with a sqlc.yaml with the process plugin config:

brew install sqlc
go install github.com/nzoschke/sqlc-gen-zz@latest
sqlc generate
version: "2"

plugins:
  - name: zz
    process:
      cmd: sqlc-gen-zz

sql:
  - codegen:
      - out: c
        plugin: zz
    engine: "sqlite"
    queries: "query.sql"
    schema: "schema.sql"

Time Convention

If a text field ends with _at it is converted from/to a YYYY-MM-DD HH:MM:SS string and a time.Time in support of:

created_at TEXT DEFAULT CURRENT_TIMESTAMP NOT NULL

JSON Overrides

By default this will use []byte for JSON column type.

But like sqlc JSON overrides, you can specify a struct and this will marshal/unmarshal the struct automatically.

Note that overrides are passed in through the plugin options.

Development

rm -rf pkg/sql/c
go install ./... 
go generate ./...
go test ./...

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
db
gen
sql

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址