Skip to content

Feature Request : Option to not export CREATE TABLE #556

Closed

Description

@elpoolet

Hi

It would be nice to add an option to only export to SQL the records and not the whole structure of the database ie :
When using menu Export / To SQL add an option like 'Do not export Database/Tables Structure' in order to only have the "INSERT INTO" records in the SQL File.
This can allow exporting full data, make tables structure updates with a blank database, then import new records without having to delete all CREATE TABLE and CREATE INDEX records in the SQL File.

I'm sorry but I don't have sufficient skills to do it myself...

Thanks a lot.

Sorry if I made any mistake, English is not my mother tongue

Activity

  1. MKleusberg commented on Apr 23, 2016

    @MKleusberg
    Member

    Hi Laurent
    Can you have a look at tomorrow's nightly build (or any later nightly build) and check if the new version is working for you? For downloading a nightly build see the main page of our repository. Please let us know if the new version does the job 😃

  2. elpoolet commented on Apr 25, 2016

    @elpoolet
    Author

    Hi Martin

    I just tested the last nightly build.
    It works perfectly like I expected!

    Thanks a lot ! it'll let me save lot of time !

    Just a comment : are the instructions in the out SQL : BEGIN TRANSACTION; and COMMIT; mandatory, since when we import an SQL file created by the Export function it throw an exception : cannot begin a transaction within a transaction ?
    Sorry for the OffTopic .... If necessary I'll open a new issue.
    Thanks for your reply

  3. justinclift commented on Apr 25, 2016

    @justinclift
    Member

    Hmmm, it kind of sounds like our code for importing SQL needs to recognise + skip any transaction control statements in the file. Without knowing any better, that doesn't sound too hard. 😉

  4. justinclift commented on Jul 15, 2016

    @justinclift
    Member

    @elpoolet Is a fix for the exception with "cannot begin a transaction within a transaction" still of interest to you?

    A proposed fix for this has been created by @revolter. It would be useful to have some people test it with real data before we add it.

    If you're using Windows or OSX, I can build a package with the fix included for people to test.

    Interested?

  5. elpoolet commented on Jul 15, 2016

    @elpoolet
    Author

    Hi Justin

    Sure I'm always interested.
    No problem to test this option with my real data.
    Let me know when the build is ready in order I test it.

    Thanks a lot.

  6. justinclift commented on Jul 15, 2016

    @justinclift
    Member

    Sure, are you on Windows or Mac? 😄

  7. justinclift commented on Jul 15, 2016

    @justinclift
    Member

    @elpoolet If you're on Windows, this should work for you:

        http://nightlies.sqlitebrowser.org/win64-onceoffs/DB%20Browser%20for%20SQLite-issue556v1-win64.exe

    Please try it out, and let us know if it fixes the exception for you. 😄

  8. justinclift commented on Jul 19, 2016

    @justinclift
    Member

    @elpoolet ping?

  9. elpoolet commented on Jul 19, 2016

    @elpoolet
    Author

    Sorry,

    I had to deal with my car's issues...
    Do you have the exe only build..
    because I use it as a portable version?
    Thanks and please forgive me for the answer dealy..

  10. justinclift commented on Jul 19, 2016

    @justinclift
    Member

    @elpoolet Sorry, I don't have the capability at the moment to generate the exe-only builds. 😦

    It takes a special setup to do it, and we've not needed to get it happening for anything other than the nightly builds. (so far)

  11. elpoolet commented on Jul 19, 2016

    @elpoolet
    Author

    OK.
    No problem.
    i'll test it on an x64 Windows 7 VM with my real data...

  12. justinclift commented on Jul 19, 2016

    @justinclift
    Member

    Cool, that would really help. 😄

  13. elpoolet commented on Jul 22, 2016

    @elpoolet
    Author

    Hi,

    I just tested functionnality.
    Unfortunately, the message is always here.
    I used the following sequence :

    • File / Open database
      ******Open a freshly xreated database with empty tables
    • File / Import / Database from SQL File
      ****** Chose the exported SQL file with options : keep column names in
      INSERT INTO and Export data only
    • At the question : would you create a new database... -> answer No
      Then the error is : Error : cannot start a transaction within a transaction

    Thanks and sorry for the delay...

  14. justinclift commented on Jul 22, 2016

    @justinclift
    Member

    Thanks @elpoolet, that makes complete sense. There are two places which can import SQL files and have the bug.

    1. File → Import → Database from SQL File (still needs fixing)
    2. In the "Execute SQL" tab, there's an icon to "Open SQL file". That one should be fixed.
      screen shot 2016-07-22 at 16 33 08
      Number 2 might be worth giving a shot.

    It probably won't suit large amounts of data though 😦 , because it loads the file into the "Execute SQL" window first.

  15. revolter commented on Jul 22, 2016

    @revolter
    Member

    @justinclift, Should we reopen this issue? Or can you solve it based on my partial solution?

  16. justinclift commented on Jul 22, 2016

    @justinclift
    Member

    @revolter Well, we've kind of already fixed the export part of this issue, but the import part is tracked here for #656. #656 needs to handle File → Import → "Database from SQL File" to be a complete solution. 😄

  17. revolter commented on Jul 22, 2016

    @revolter
    Member

    Sorry, pretty tired here, and having two problems on the same issue didn't help me. So, it should be a pretty easy solution if you know where the import is done. But unfortunately I can't do it at all. Do you thing you can manage it? 😄

  18. justinclift commented on Jul 22, 2016

    @justinclift
    Member

    Yeah, I should be able to cut-n-paste your RegEx into the right spot. Likely tomorrow though... I want to get away from the computer for a bit now.

    You're on holiday from tomorrow yeah? If so... have a good one, and hopefully things here haven't exploded in a bad way by the time you're back. 😀

  19. revolter commented on Jul 22, 2016

    @revolter
    Member

    Thanks!

    Actually, I'm on holiday already, since today was my last work day. And I'm sure nothing will explode 😆

  20. justinclift commented on Jul 25, 2016

    @justinclift
    Member

    @elpoolet If/when you have a minute to test, the latest nightly build should include the full fix for this.

    Any chance you could give it a shot to double check? 😄

  21. elpoolet commented on Sep 27, 2016

    @elpoolet
    Author

    Hi all

    I was in vacation till Aug 30th...
    After that, had lot of work.

    I downloaded stable version 3.9 and all features are in and works like a
    charm !!!

    Thanks a lot for these improvements... and sorry for my last response
    time...

  22. justinclift commented on Sep 27, 2016

    @justinclift
    Member

    You're welcome @elpoolet. 😄

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions