Giter VIP home page Giter VIP logo

Comments (8)

fmluizao avatar fmluizao commented on May 21, 2024

You can inform this option in your configuration file using 'additional_options' like this:

adapter :mysql do
  user        'user'
  password    'password'
  database    'database'
  skip_tables ['table1', 'table2', 'table3']
  options do
    host    '123.45.678.90'
    port    '80'
    socket  '/tmp/socket.sock'
  end
  additional_options '--single-transaction'
end

from backup.

mrrooijen avatar mrrooijen commented on May 21, 2024

This isn't really an issue, but we could perhaps just implement that this is default behavior. What are the pros en cons of using --single-transaction?

from backup.

wakiki avatar wakiki commented on May 21, 2024

As far as I know you almost always want to use
additional_options '--single-transaction --quick'
if your database supports transactions (mysql does)

from backup.

mrrooijen avatar mrrooijen commented on May 21, 2024

Thanks for pointing that out, I will mark this as a consideration. Might be a good idea set these options as defaults.

from backup.

fmluizao avatar fmluizao commented on May 21, 2024

Mysql doesn't support transactions, some storage engine does, like InnoDB. I don't think this option should be enabled by default, because other people uses other storage engines.

from backup.

mrrooijen avatar mrrooijen commented on May 21, 2024

Good point, I did not know that. In that case it's not wise to set it as default since it will literally break MySQL adapter for some users.

I guess the commented out template in the backup configuration file will be enough to point out the option IS available but needs to be activated: additional_options '--single-transaction'.

We could additionally add this that line: --quick so it would make: --single-transaction --quick.

from backup.

mrrooijen avatar mrrooijen commented on May 21, 2024

I will add the --single-transaction --quick to the generated template, but leave it commented out. Maybe add a comment that tell it to uncomment this line if the database is large so that it doesn't lock tables and such, but that it isn't supported for all storage engines.

from backup.

wakiki avatar wakiki commented on May 21, 2024

That sounds like a great idea. Thanks.

from backup.

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.