Thread
#exposed
    m

    Marcel Overdijk

    1 year ago
    Hi, I'm wondering if #exposed could also be used as a SQL generator (without interacting with the database itself). In my case I have data in various CSV files for which I need to generate a *.sql script with DDL and insert statements. The generated *.sql script can then be used by others to import it in their database. Now
    SchemaUtils
    has a
    createStatements
    fun that could do the DDL part, but I cannot find anything to simply generate the SQL for inserts.
    e

    Endre Deak

    1 year ago
    what do you mean by interaction?
    m

    Marcel Overdijk

    1 year ago
    I mean not writing to the database itself (not even having a database connection) I basically just want to define the table deifnitiions, and write the DDL statements from it to a file, together with generated insert statements.
    e

    Endre Deak

    1 year ago
    I’ve tried the same but with read queries and it seems that currently you must have at least one active transaction to get the corresponding SQL
    m

    Marcel Overdijk

    1 year ago
    Thx for confirming, I thought the same