Configuration

This section describes the format of the Fauna Data Manager configuration file, fdm.props.

The fdm.props file is an optional file where commonly-used command line options, plus some additional options, can be placed. This is handy if you need to run the Fauna Data Manager repeatedly with common configuration options.

The fdm.props file is a standard Java properties file, consisting of one or more lines using the format property_name = property_value. Blank lines and lines beginning with # are ignored.

The default fdm.props file looks like this:

### FaunaDB Data Manager properties
#
# The key to the database
# Default: secret
#
# key=secret

# The name or IP of the FaunaDB instance to connect to
# Default: db.fauna.com
#
# host=11.22.33.44

# The key to the database
# Default: https
#
# protocol=http

# The port number that FaunaDB is listening on
# Default: 8443
#
# port=8443

# The format transformation allows you to rename fields or cast values
# to new types. The general layout of the format:
#   <field-name>[->new-name]:<field-type>[(date_format)],...
# Default: None
#
# Example:
# format=power_usage->used_power,sic_code:long,ta_start:date(yyyy-mm-dd),outage_id:ID,time_start:ts(mm-dd-yy hh:mm),time_end:ts(mm/dd/yy hh:mm:ss)

# The name document to insert in a single transaction.
# Default: 100
#
# transactionSize=100

## JDBC properties, used to connect to a JDBC database

# The vendor-specified namespace for the driver
#
# jdbc.driver=<ENTER THE JDBC DRIVER NAMESPACE HERE>

# The connection URL for the JDBC server
#
# jdbc.url=<ENTER A JDBC URL HERE>

# The userid that should be used to connect to the JDBC server
#
# jdbc.property.user=<ENTER A USERID HERE>

# The password for the userid connecting to the JDBC server
#
# jdbc.property.password=<ENTER A PASSWORD HERE>

# The name of the database to access on the JDBC server
#
# jdbc.property.database=<ENTER A DATABASE NAME HERE>

# Optional: The name of a specific table to access on the JDBC server.
# When not specified, all tables in the JDBC database are evaluated.
#
# jdbc.property.table=<ENTER A TABLE NAME HERE>

# Other JDBC properties can be specified here. Use the prefix
# jdbc.property. when specifying them.
#
# jdbc.property.serverTimezone=<ENTER A TIMEZONE STRING HERE>

# Debug options, one of:
#   0: Off
#   1: Light
#   2: Med
#   3: Heavy
# Default: 0
#
# debug=0

All of the included properties are commented out. Remove the leading # from any property you wish to use, and set the property’s value accordingly.

Properties

Property Description

dateFormat

Optional - Specifies a global date format. The default value is MM-dd-yyyy

format

Optional - Specifies a comma-separated list of format transformations that describe how fields and their values should be converted during processing. A field can be renamed, or its value can be cast to a new type.

Example: format=power_usage→used_power,code:long

See Format transformations for details.

This is equivalent to the -f<arg>/--format <arg> command-line parameter.

jdbc.driver

Specifies the Java namespace required to use the vendor’s driver.

For example, to specify using the MySQL driver:

jdbc.driver=com.mysql.cj.jdbc.Driver

jdbc.url

Specifies the JDBC URL to connect your JDBC database.

Specifying JDBC properties as URL query parameters is not currently supported.

You can specify any JDBC property required by including jdbc.property.<property name>=<property value> in fdm.props.

All such properties specified are appended to the jdbc.url as query parameters when connecting to the JDBC database.

jdbc.property.user

Specifies the userid that should be used to connect to your JDBC database. The specified userid must have privileges to read from the associated database and tables.

This is equivalent to the user command-line parameter.

jdbc.property.password

Specifies the password for the userid that is used to connect to your JDBC database.

This is equivalent to the password command-line parameter.

jdbc.property.database

Specifies the name of the database that should provide records.

This is equivalent to the database command-line parameter.

jdbc.property.table

Specifies the name of a single table that should provide records. When not specified, all available tables provide records. Each table name becomes the name of a collection.

This is equivalent to the table command-line parameter.

load

Optional - Specifies the file path, comma-separated list of file paths, or the path to a directory containing files, to use for importing.

When not specified, the default value is data.json.

The type of each path is auto-detected by examining the first few lines of each file, and not by the file extension.

Each path’s filename informs the name of a Fauna collection in the destination database, and the contents of the file describe the documents that should be created in the destination database.

Examples:

  • load=customer.json

  • load=customer.json,names.json,employee.json

  • load=/work/my_directory

This is equivalent to the path command-line parameter.

policy.collection

Optional - Specifies the policy for processing collections. The value for policy.collection must be one of exists or replace. The default is exists. See Schema policies for details.

This is equivalent to the collection command-line parameter.

policy.data

Optional - Specifies the policy for processing documents. The value for policy.data must be one of copy, or ignore. The default is copy. See Document policy for details.

This is equivalent to the data command-line parameter.

policy.function

Optional - Specifies the policy for processing functions. The value for policy.function must be one of exists, replace, or ignore. The default is exists. See Schema policies for details.

This is equivalent to the function command-line parameter.

host

Optional - Specifies the Fauna host to connect to. The default value is db.fauna.com.

policy.index

Optional - Specifies the policy for processing indexes. The value for policy.index must be one of exists, replace, or ignore. The default is exists. See Schema policies for details.

This is equivalent to the index command-line parameter.

policy.role

Optional - Specifies the policy for processing roles. The value for policy.role must be one of exists, replace, or ignore. The default is exists. See Schema policies for details.

This is equivalent to the role command-line parameter.

port

Optional - Specifies the Fauna port to connect to. The default value is 8443.

protocol

Optional - Specifies the HTTP protocol to use when connecting to a Fauna host. Must be one of http or https. The default value is http.

secret

Optional - Specifies the admin key’s secret to use when connecting to the source database.

This is equivalent to the key command-line parameter.

transactionSize

Optional - Specifies the number of records to bundle into a single Fauna transaction. The default value is 100.

Smaller numbers tend to make the overall import/copy perform somewhat slower. Larger numbers can make the overall import/copy perform faster.

There is a 16 megabyte limit to the size of any transaction. The Fauna Data Manager automatically reduces the size of each transaction to fit within that limit. This means that values over 10,000 tend to have no affect.

Large values can make identifying the source of errors much more difficult.

Example: transactionSize=50

This is equivalent to the --tsize <size> command-line parameter.

tsFormat

Optional - Specifies a global timestamp format. The default value is yyyy-MM-dd’T’HH:mm:ss’Z'

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!