Writer Directives

The directives that are processed by the SQLite3 writer are listed below. The suffixes shown are prefixed by the writer keyword in a mapping file. By default, the <WriterKeyword> for the SQLite3 writer is SQLITE3FDO.

DATASET

Required/Optional: Required

The value for this keyword is the name of the output SQLite3 file. If an existing file is specified, that file will be overwritten unless otherwise specified by the OVERWRITE_FILE directive. A typical mapping file fragment specifying an output SQLite3 dataset looks like:

SQLITE3FDO_DATASET /tmp/data.db

Workbench Parameter: Destination SQLite3 Spatial (FDO) Database File

DEF

Required/Optional: Required

The SQLite3 writer uses DEF lines to define feature types in the output file. A typical mapping file fragment specifying an output feature type looks like:

SQLITE3FDO_DEF <featureName> \
	[fdo_index_column <fdo_index_column>]\								
	[fdo_writer_mode <fdo_writer_mode>] \
	[fdo_geometry_column <fdo_geometry_column>] \
	[fdo_overwrite_table <fdo_overwrite_table>] \								
	[<attributeName> <attributeType>[,<indexType>]]*

The configuration parameters present on the definition line are described in the following table:

Parameter

Contents

featureName

This declares the name of the feature type to be written.

fdo_index_column

This specifies the name of the default index attribute that is added to the feature type if no user attribute is specified with an IDENTITY index type.

Default: PRIMARYINDEX

fdo_writer_mode

This specifies the feature type level writer mode settings.

Valid values are INSERT, UPDATE, DELETE, and INHERIT_FROM_WRITER.

Note that INSERT mode allows for only INSERT operations where as UPDATE and DELETE can be overwritten at the feature levels. INHERIT_FROM_WRITER simply indicates to take this value from the writer level and not to override it at the feature type level.

Default: INHERIT_FROM_WRITER

fdo_geometry_column

This specifies the name of the geometry attribute that will hold the geometry when creating a new feature type in the output file.

Default: Geometry

fdo_overwrite_table

This specifies the action to be taken if a feature type already exists in the output file with the name specified by featureName.

Valid values are YES, NO, and TRUNCATE.

Default: NO

attributeName

This declares the name of the attribute.

The maximum length of attribute names is 100 characters.

attributeType

This declares the type of the data property. The valid values are:

boolean

datetime

decimal(width, precision)

int16

int32

int64

byte

single

double

char(width)

blob(width)

clob(width)

indexType

The valid value is:

IDENTITY

Attributes with an IDENTITY index type must uniquely identify the feature within the feature type: features with non-unique values for IDENTITY attributes cannot be inserted into the output SDF3 file.

If multiple attributes are declared with an IDENTITY index type, then those multiple attribute form a composite identity key.

OVERWRITE_FILE

Required/Optional: Optional

This directive specifies whether the output file should be overwritten, if it exists. If this directive is set to NO, then the SQLite3 writer will append the new features to the dataset.

The default value for this directive is NO.

SQLITE3FDO_OVERWRITE_FILE NO

Workbench Parameter: Overwrite File

WRITER_MODE

Required/Optional: Optional

Note: For more information on this directive, see the chapter Database Writer Mode.

This directive specifies the operations that will be performed by default by this writer. The operations are INSERT, UPDATE, or DELETE. The default writer-level value for this operation can be overwritten at the feature type level. The corresponding feature type DEF parameter name is called WRITER_MODE. It has the same valid options as the writer-level mode, as well as the value INHERIT_FROM_WRITER, which causes the writer-level mode to be inherited by the feature type as the default for features written to that feature type.

This operation can also be set for individual features, using the fme_db_operation attribute. Note that when WRITER_MODE is set to INSERT, all features are inserted unless otherwise set for UPDATE or DELETE.

If the WRITER_MODE directive is not specified, then a value of INSERT is given.

SQLITE3FDO_WRITER_MODE INSERT

Workbench Parameter: Writer Mode

REMOVE_SCHEMA_QUALIFIER

Required/Optional: Optional

The value for this keyword is either yes or no. A value of yes indicates that the feature type name in FME should not contain the schema name prefix before the table name. The default value of no indicates the table name will contain the schema prefix separated by a period.

SQLITE3FDO_REMOVE_SCHEMA_QUALIFIER NO
SQLITE3FDO_DEF default.mytable

or

SQLITE3FDO_REMOVE_SCHEMA_QUALIFIER YES
SQLITE3FDO_DEF mytable