nene
nene
is a command-line tool to generate Rust code for Google Cloud Spanner.
nene
uses database schema to generate code by using Information Schema. nene
runs SQL queries against tables in INFORMATION_SCHEMA to fetch metadata for a database, and applies the metadata to Go templates to generate code/models to acccess Cloud Spanner.
Installation
docker pull ghcr.io/yoshidan/nene/nene:0.1.0
Usage
services:
nene:
image: ghcr.io/yoshidan/nene/nene:0.1.0
command: -o /model #-i /template
volumes:
- ./model:/model
# - ./template:/template
environment:
RUST_LOG: info
SPANNER_DSN: projects/local-project/instances/test-instance/databases/local-database
# if you don't use emulator use GOOGLE_APPLICATION_CREDENTIALS instead of SPANNER_EMULATOR_HOST
SPANNER_EMULATOR_HOST: host.docker.internal:9010
-
-i
- template directory.
- see template directory structure
- if not specified default template are used.
-
-o
- output directory
- default directory is
./gen
Generated file with default template
Default template generates the files for google-cloud-spanner.