Skip to content

Instantly share code, notes, and snippets.

@afefelov
Created April 5, 2021 10:39
Show Gist options
  • Save afefelov/4495f03df1e1922e2829e97093e9dcd5 to your computer and use it in GitHub Desktop.
Save afefelov/4495f03df1e1922e2829e97093e9dcd5 to your computer and use it in GitHub Desktop.
Sample config for pg_obfuscator against pagila database
---
main:
data_types_map:
citext: String
inet: IPv4
int2: Int8
int4: Int8
int8: Int8
varchar: String
timestamp: DateTime
text: String
tables:
skip_obfuscation: [address, category]
skip_loading: []
tables:
actor:
excluded_columns:
- actor_id
- last_update
columns:
actor_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
first_name:
db_data_type: text
not_null: true
obfuscator_data_type: String
last_name:
db_data_type: text
not_null: true
obfuscator_data_type: String
fake_data:
type: pattern
value: "%{first_name}SON"
last_update:
db_data_type: timestamptz
not_null: true
address:
excluded_columns:
- address_id
- city_id
- last_update
columns:
address_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
address:
db_data_type: text
not_null: true
obfuscator_data_type: String
address2:
db_data_type: text
not_null: false
obfuscator_data_type: Nullable(String)
district:
db_data_type: text
not_null: true
obfuscator_data_type: String
city_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
postal_code:
db_data_type: text
not_null: false
obfuscator_data_type: Nullable(String)
phone:
db_data_type: text
not_null: true
obfuscator_data_type: String
last_update:
db_data_type: timestamptz
not_null: true
category:
excluded_columns:
- category_id
- last_update
columns:
category_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
name:
db_data_type: text
not_null: true
obfuscator_data_type: String
last_update:
db_data_type: timestamptz
not_null: true
city:
excluded_columns:
- city_id
- country_id
- last_update
columns:
city_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
city:
db_data_type: text
not_null: true
obfuscator_data_type: String
country_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
last_update:
db_data_type: timestamptz
not_null: true
country:
excluded_columns:
- country_id
- last_update
columns:
country_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
country:
db_data_type: text
not_null: true
obfuscator_data_type: String
last_update:
db_data_type: timestamptz
not_null: true
customer:
excluded_columns:
- customer_id
- store_id
- address_id
- activebool
- create_date
- last_update
columns:
customer_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
store_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
first_name:
db_data_type: text
not_null: true
obfuscator_data_type: String
last_name:
db_data_type: text
not_null: true
obfuscator_data_type: String
email:
db_data_type: text
not_null: false
obfuscator_data_type: Nullable(String)
address_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
activebool:
db_data_type: bool
not_null: true
create_date:
db_data_type: date
not_null: true
last_update:
db_data_type: timestamptz
not_null: false
active:
db_data_type: int4
not_null: false
obfuscator_data_type: Nullable(Int8)
film:
excluded_columns:
- film_id
- release_year
- language_id
- original_language_id
- rental_rate
- replacement_cost
- rating
- last_update
- special_features
- fulltext
columns:
film_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
title:
db_data_type: text
not_null: true
obfuscator_data_type: String
description:
db_data_type: text
not_null: false
obfuscator_data_type: Nullable(String)
release_year:
db_data_type: year
not_null: false
language_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
original_language_id:
db_data_type: int4
not_null: false
obfuscator_data_type: Nullable(Int8)
rental_duration:
db_data_type: int2
not_null: true
obfuscator_data_type: Int8
rental_rate:
db_data_type: numeric
not_null: true
length:
db_data_type: int2
not_null: false
obfuscator_data_type: Nullable(Int8)
replacement_cost:
db_data_type: numeric
not_null: true
rating:
db_data_type: mpaa_rating
not_null: false
last_update:
db_data_type: timestamptz
not_null: true
special_features:
db_data_type: _text
not_null: false
fulltext:
db_data_type: tsvector
not_null: true
film_actor:
excluded_columns:
- actor_id
- film_id
- last_update
columns:
actor_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
film_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
last_update:
db_data_type: timestamptz
not_null: true
film_category:
excluded_columns:
- film_id
- category_id
- last_update
columns:
film_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
category_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
last_update:
db_data_type: timestamptz
not_null: true
inventory:
excluded_columns:
- inventory_id
- film_id
- store_id
- last_update
columns:
inventory_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
film_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
store_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
last_update:
db_data_type: timestamptz
not_null: true
language:
excluded_columns:
- language_id
- name
- last_update
columns:
language_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
name:
db_data_type: bpchar
not_null: true
last_update:
db_data_type: timestamptz
not_null: true
rental:
excluded_columns:
- rental_id
- rental_date
- inventory_id
- customer_id
- return_date
- staff_id
- last_update
columns:
rental_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
rental_date:
db_data_type: timestamptz
not_null: true
inventory_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
customer_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
return_date:
db_data_type: timestamptz
not_null: false
staff_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
last_update:
db_data_type: timestamptz
not_null: true
staff:
excluded_columns:
- staff_id
- address_id
- store_id
- active
- last_update
- picture
columns:
staff_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
first_name:
db_data_type: text
not_null: true
obfuscator_data_type: String
last_name:
db_data_type: text
not_null: true
obfuscator_data_type: String
address_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
email:
db_data_type: text
not_null: false
obfuscator_data_type: Nullable(String)
store_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
active:
db_data_type: bool
not_null: true
username:
db_data_type: text
not_null: true
obfuscator_data_type: String
password:
db_data_type: text
not_null: false
obfuscator_data_type: Nullable(String)
last_update:
db_data_type: timestamptz
not_null: true
picture:
db_data_type: bytea
not_null: false
store:
excluded_columns:
- store_id
- manager_staff_id
- address_id
- last_update
columns:
store_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
manager_staff_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
address_id:
db_data_type: int4
not_null: true
obfuscator_data_type: Int8
last_update:
db_data_type: timestamptz
not_null: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment