How are you defining the custom collating sequences?
Any custom collating sequences (which are referenced in table schema definitions) will need to be available to the database connection at the time you run sqlcipher_export.
Without it being available, you would run into a similar error message as this when trying to create a new table definition referencing the custom collating sequence (when it’s not available).
If you’re defining the collating sequences using sqlite3_create_collation notice that the collating sequence is only available until the connection is closed:
Collating functions are deleted when they are overridden by later calls to the collation creation functions or when the database connection is closed using sqlite3_close().
Because of that, without seeing more code, I’d speculate that you could be:
Opening the database connection.
Create the collation when creating the table.
Closing the database connection and re-opening it without defining sqlite3_create_collation.
Attempting to sqlcipher_export
Any collation sequences which would need to be available when creating the table schema need to be available when using sqlcipher_export as well, so you’ll need to make the custom collation sequences available to the connection prior to performing sqlcipher_export
Hi @mmoore,
Thanks for the quick response and the explanation. You are correct the collating sequence was not available while calling the sqlcipher_export. The database in question is created in an Android application and I think it will not be possible to create the same collation sequence with SQLite command line interface.
Is there any workaround for that?
Hello @Shyamal_Shah - The main workaround would be to recreate your custom collate for the platform where you are running the command line interface. If you build it as a loadable module you can load it into the shell and then use it during export. Another option would be to run the export on android where you have the collation available.