Hi Prameeth,

Just cut and past the shell.c routines:

open_db
shellstaticFunc
appendText
run_table_dump_query
dump_callback

run_schema_dump_query           <- this is the top level routine


Look at the code for dump command to dump everything use:

run_schema_dump_query(p,
        "SELECT name, type, sql FROM sqlite_master "
        "WHERE sql NOT NULL AND type=='table'", 0
      );
      run_table_dump_query(p->out, p->db,
        "SELECT sql FROM sqlite_master "
        "WHERE sql NOT NULL AND type IN ('index','trigger','view')"
      );

To dump one or more (ie a list)

        run_schema_dump_query(p,
          "SELECT name, type, sql FROM sqlite_master "
          "WHERE tbl_name LIKE shellstatic() AND type=='table'"
          "  AND sql NOT NULL", 0);
        run_table_dump_query(p->out, p->db,
          "SELECT sql FROM sqlite_master "
          "WHERE sql NOT NULL"
          "  AND type IN ('index','trigger','view')"
          "  AND tbl_name LIKE shellstatic()"

That should just about take care of it....
You might need a few others, to proper link etc.

HTH,
Ken

Prameeth Sreesha <[EMAIL PROTECTED]> wrote:  Hi,

I have an application that has to provide an export/import feature of the
sqlite database. I have achieved the export through the normal "Select *
>From TABLENAME" to export the database. I went through the C API
Documentation reference but did not come across any such API. If there are
APIs that performs the export/import in a better way, please let me know.

 DISCLAIMER: I cannot use the sqlite command line and have to use the C
Interface to achieve this. I tried to go through the code for the .dump
command from sqlite CLI, but got lost :(

-- 
Regards,
Prameeth


-- 
Regards,
Prameeth

Reply via email to