Skip to content

Export database as SQL script #110

Open

Description

@andrew-aladev

SQLite have .dump command, MySQL have special tool mysqldump. Do you have something similar?

Activity

  1. agershun commented on Apr 1, 2015

    @agershun
    Member

    Sorry, not yet.

    There are some command to dump data to SQL:

        SELECT * INTO SQL("mydata.sql") FROM one;

    and

        SHOW CREATE TABLE one;

    But not whole database.

  2. agershun commented on Apr 2, 2015

    @agershun
    Member

    What do you thing, what approach llisted below is better?

    a) to have dump command for specific database, like:

        var sql = alasql('DUMP DATABASE mybase');

    b) dump all databases in current alasql object:

        var sql = alasql('DUMP');
  3. mathiasrw commented on Apr 2, 2015

    @mathiasrw
    Member

    Another solution (not involving making new "SQL" things) would be to extend the alasql object with a dump method

    var sql = alasql().dump();

    Should work on both alasql and objects created from new alasql

  4. agershun commented on Apr 3, 2015

    @agershun
    Member

    I think it is a good idea to minimize alasql() interface, because in case of alasql.dump() we need to maintain this additional function in WebWorker version (alasql-worker.js), but in case of res = alasql('DUMP'); or `res = alasql('DUMP DATABASE mybase');`` Alasql will use the same version.

    Of course, alasql.dump() can be accessible as a function outside, but only for non-worker version.

  5. mathiasrw commented on Jul 14, 2015

    @mathiasrw
    Member

    What do you thing, what approach llisted below is better?

    a) to have dump command for specific database, like:

    var sql = alasql('DUMP DATABASE mybase');
    

    b) dump all databases in current alasql object:

    var sql = alasql('DUMP');
    

    I like it. I have added it to the feature requests

    http://feathub.com/agershun/alasql/+25

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions