Skip to content

senzing-garage/init-database

Repository files navigation

init-database

If you are beginning your journey with Senzing, please start with Senzing Quick Start guides.

You are in the Senzing Garage where projects are "tinkered" on. Although this GitHub repository may help you understand an approach to using Senzing, it's not considered to be "production ready" and is not considered to be part of the Senzing product. Heck, it may not even be appropriate for your application of Senzing!

⚠️ WARNING: init-database is still in development ⚠️ _

At the moment, this is "work-in-progress" with Semantic Versions of 0.n.x. Although it can be reviewed and commented on, the recommendation is not to use it yet.

Synopsis

init-database is a command in the senzing-tools suite of tools. This command initialize databases with a Senzing schema and a default Senzing configuration.

Go Reference Badge Go Report Card Badge License Badge go-test-linux.yaml Badge go-test-darwin.yaml Badge go-test-windows.yaml Badge

golangci-lint.yaml Badge

Overview

init-database performs the following:

  1. Creates a Senzing database schema from a file of SQL statements. The SQL file is identified by the SENZING_TOOLS_SQL_FILE parameter. The default file name depends on the database engine specified in the protocol section of SENZING_TOOLS_DATABASE_URL or the database(s) specified in SENZING_TOOLS_ENGINE_CONFIGURATION_JSON. The default file location depends on the Senzing engine configuration JSON's PIPELINE.RESOURCEPATH value.
  2. Creates a Senzing configuration in the database based on the contents of the file specified by the SENZING_TOOLS_ENGINE_CONFIGURATION_FILE parameter. The default file location is based on the Senzing engine configuration JSON's PIPELINE.RESOURCEPATH value.
  3. Optionally: Adds datasources to the initial Senzing configuration via the SENZING_TOOLS_DATASOURCES parameter.

Install

  1. The init-database command is installed with the senzing-tools suite of tools. See senzing-tools install.

Use

export LD_LIBRARY_PATH=/opt/senzing/er/lib/
senzing-tools init-database [flags]
  1. For options and flags:

    1. Online documentation

    2. Runtime documentation:

      export LD_LIBRARY_PATH=/opt/senzing/er/lib/
      senzing-tools init-database --help
  2. In addition to the following simple usage examples, there are additional Examples.

Using command line options

  1. ✏️ Specify database using command line option. Example:

    export LD_LIBRARY_PATH=/opt/senzing/er/lib/
    senzing-tools init-database \
        --database-url postgresql://username:password@postgres.example.com:5432/G2
  2. See Parameters for additional parameters.

Using environment variables

  1. ✏️ Specify database using environment variable. Example:

    export SENZING_TOOLS_DATABASE_URL=postgresql://username:password@postgres.example.com:5432/G2
    export LD_LIBRARY_PATH=/opt/senzing/er/lib/
    senzing-tools init-database
  2. See Parameters for additional parameters.

Using Docker

This usage shows how to initialze a database with a Docker container.

  1. ✏️ Run senzing/senzing-tools. Example:

    docker run \
        --env SENZING_TOOLS_COMMAND=init-database \
        --env SENZING_TOOLS_DATABASE_URL=postgresql://username:password@postgres.example.com:5432/G2 \
        --rm \
        senzing/senzing-tools
  2. See Parameters for additional parameters.

Parameters

References