Skip to main content
Version: Next

RealAddress

Generates real addresses for specified database columns using the faker library. It supports customization of the generated address format through Go templates.

Parameters

NamePropertiesDescriptionDefaultRequiredSupported DB types
columnsSpecifies the affected column names along with additional properties for each columnYesVarious
nameThe name of the column to be affectedYesstring
templateA Go template string for formatting real address attributesYesstring
keep_nullIndicates whether NULL values should be preservedNobool

Template value descriptions

The template parameter allows for the injection of real address attributes into a customizable template. The following values can be included in your template:

  • {{.Address}} — street address or equivalent
  • {{.City}} — city name
  • {{.State}} — state, province, or equivalent region name
  • {{.PostalCode}} — postal or ZIP code
  • {{.Latitude}} — geographic latitude
  • {{.Longitude}} — geographic longitude

These placeholders can be combined and formatted as desired within the template string to generate custom address formats.

Description

The RealAddress transformer uses the faker library to generate realistic addresses, which can then be formatted according to a specified template and applied to selected columns in a database. It allows for the generated addresses to replace existing values or to preserve NULL values, based on the transformer's configuration.

Example: Generate Real addresses for the employee table

This example shows how to configure the RealAddress transformer to generate real addresses for the address column in the employee table, using a custom format.

RealAddress transformer example
- schema: "humanresources"
name: "employee"
transformers:
- name: "RealAddress"
params:
columns:
- name: "address"
template: "{{.Address}}, {{.City}}, {{.State}} {{.PostalCode}}"
keep_null: false

This configuration will generate real addresses with the format "Street address, city, state postal code" and apply them to the address column, replacing any existing non-NULL values.

Copyright © GreenMask 2026