jdbigen

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

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

Go to latest
Published: May 12, 2022 License: MIT Imports: 21 Imported by: 0

README

jdbigen

jdbigen generates Java interfaces and classes for simple DAO functions from PostgreSQL table metadata. This based off of the awesome dgw project.

IMPORTANT NOTE: jdbigen only supports PostgreSQL at the moment and is also a best effort generator so you may have to edit the generated code.

Installation

go install github.com/nndi-oss/jdbi-utils/jdbigen@latest

How to use

usage: jdbigen [<flags>] <conn>

Flags:
      --help                 Show context-sensitive help (also try --help-long and --help-man).
  -s, --schema="public"      PostgreSQL schema name
  -p, --package=""           package name
  -t, --typemap=TYPEMAP      column type and go type map file path
  -x, --exclude=EXCLUDE ...  table names to exclude
  -o, --output=OUTPUT        output file path
      --sqlhandle            output as SQL handlers

Args:
  <conn>  PostgreSQL connection string in URL format
jdbigen postgres://dbuser@localhost/dbname?sslmode=disable 

ROADMAP

  1. Fix and improve the tests
  2. I am planning on re-writing this in Java and compiling a native image with GraalVM.
  3. Support other database engines?

Documentation

Overview

Code generated for package main by go-bindata DO NOT EDIT. (@generated) sources: template/class.tmpl template/pagination.tmpl template/sqlobject.tmpl template/usehandle.tmpl

go:generate go-bindata -o bindata.go template mapconfig

Jump to

Keyboard shortcuts

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