Skip to content

added sqlstatements to mask/delete/truncate tables#49

Open
elcoda wants to merge 1 commit intoSteveiwonder:masterfrom
elcoda:master
Open

added sqlstatements to mask/delete/truncate tables#49
elcoda wants to merge 1 commit intoSteveiwonder:masterfrom
elcoda:master

Conversation

@elcoda
Copy link

@elcoda elcoda commented Nov 21, 2024

If you are interested we developed an extra config .json files to execute arbitrary SQL statements during masking.
We use them to truncate tables on our db or to do some batch updates on them.

Have a look to sqlStatements on the following json example:

{
    "dataSource": {
        "type": "SqlServer",
        "config": {
            "connectionString": "Data Source=xxxxxxxxxxxxxxxxxxxxxxxx"
        }
    },
    "dataGeneration": {
        "locale": "it"
    },
    "tables": [
        {
            "name": "zero_table",
            "primaryKeyColumn": "id",
            "columns": [
              {
                "name": "Note",
                "type": "Sql",
                "sqlValue": {
                  "query": "select 1"
    
                }
              }
            ]
        }
    ],

    "sqlStatements": [
        {
            "name": "SqlVolante",
            "statement": "Truncate table first_table"
        },
        {
            "name": "SqlVolante1",
            "statement": "Truncate table second_table"
        }
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant