Categorygithub.com/willowtreeapps/rootx
modulepackage
0.0.1
Repository: https://github.com/willowtreeapps/rootx.git
Documentation: pkg.go.dev

# README

WillowTree is Hiring!

Want to write Go for mobile applications? Want to write anything else for mobile applications? Check out our openings!

RootX

Helper functions and code generation tools for https://github.com/jmoiron/sqlx.

Blog post coming soon!

Installation

go get github.com/willowtreeapps/rootx/...

Command Usage

$ rootx-gen -h
Usage of rootx-gen:
  -dir string
    	Directory containing sql files
  -dryRun
    	Output to STDOUT instead of writing files
  -formatter string
    	Command to use to format source code (gofmt, goimports) (default "goimports")
  -mode string
    	Mode for generator: code | mock | interface (default "code")
  -o string
    	Output file
  -pkg string
    	Go package to use
  -psql
    	Whether to use Postgres insert strategy, using "RETURNING id" (default true)
  -readType string
    	Type of instance to use for read methods
  -writeType string
    	Type of instance to use for write methods

# Packages

No description provided by the author

# Functions

DeleteOne deletes a single instance.
Exec executes a statement.
Exists checks to see if the item exists by a COUNT query.
Insert inserts a single instance.
InsertPsql inserts a single instance.
ScanOne returns the instance, if any, returned from sql query.
SelectAll selects a slice of structs.
SelectOne selects a single struct.
UpdateOne updates a single instance.

# Structs

Error defines an error that can occur in Rootx helper methods.

# Interfaces

Rootx defines an interface that needs to be implemented to take advantage of the Rootx helper methods.