Code Monkey home page Code Monkey logo

Comments (7)

TitanNano avatar TitanNano commented on July 22, 2024 1

@jerometwell the new table strategy works as expected / described.

from pynonymizer.

rwnx avatar rwnx commented on July 22, 2024

Hi! There is already a truncate table strategy, does this work for you?

https://github.com/jerometwell/pynonymizer/blob/master/doc/strategyfiles.md#table-strategy-truncate

from pynonymizer.

rwnx avatar rwnx commented on July 22, 2024

If i understand what you're trying to achieve ( cascading delete) then TRUNCATE won't work anyway.
IIRC truncate isn't suitable for tables with foreign keys.
You'd need a DELETE statement. Is this a feature you need?

As a workaround, you could add this as a before script:

scripts:
  before:
    - DELETE FROM table;

from pynonymizer.

TitanNano avatar TitanNano commented on July 22, 2024

@jerometwell yes you are correct, TRUNCATE doesn't actually work with foreign keys. The before script works, but an official table strategy would be more handy I think.

from pynonymizer.

rwnx avatar rwnx commented on July 22, 2024

@TitanNano in this scenario, would you have foreign key checks with CASCADE enabled? or were you implying that pynonymizer should do discovery also?

I'm just writing documentation and i want to be sure on the use-case.

I've started PR #23 for this issue. If you could take a look at the implementation I'd appreciate a second pair of eyes.

from pynonymizer.

TitanNano avatar TitanNano commented on July 22, 2024

@jerometwell yes CASCADE is enabled in our scenario. I will have a look at your WIP.

from pynonymizer.

rwnx avatar rwnx commented on July 22, 2024

This change has been merged into master and should go out with v1.13.0 - please test and report back if you can!

from pynonymizer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.