Skip to main content

How ANO Types Works

TL;DR

The ANO DSL Language uses the following database agnostic types when describing columns:

  • integer, decimal, text, date, time, datetime, bool

Data types are inferred from your database column types.

Their main function is to guide the user to pick the correct data generation logic, in the ANO Language, so SQL statements do not fail against the database.

How ANO types are handled in the Java Runtime Application

The Java Runtime Application, which is generated from your provided .ano file utilizing the DBmasker Service, will construct SQL Statements that can be run against the database.

The anonymized data will be made using input-sources according to specific types. But the resuling values from the anonymization rules, i.e. from the format <format>, are not type checked.

They are intermittently stored as java.lang.String, before being passed to the created SQL statements. The SQL statements themselves are constructed as pure text strings, and no typing is necessary.

Long / Bigint Example

You cannot generate BIGINT / Long numbers directly in Ano syntax. But you can combine Integer generation to produce numbers outside the normal Integer range.

  • Integer range: [-2147483647, 2147483647] - 10 digit maximum
  • Long range: [-9223372036854775808, 9223372036854775807 ] - 19 digit maximum

Given database table (MySql)

 TABLE Customer (
ID int NOT NULL AUTO_INCREMENT,
customerNo BIGINT not null,
CONSTRAINT Customer_PK PRIMARY KEY (ID),
CONSTRAINT Customer_UK UNIQUE (customerNo)
)

Populating a 16 digit Long / BIGINT value into customerNo

table Customer
column integer id
column integer customerNo
...
task <task-name> {
update Customer
mask customerNo
format "%d%d"
unique
random-integer 10000000 99900000
random-integer 10000000 99900000
}

Results: The column gets populated with 16 digit values