method
sqlite.Database.close
Close the database connection.
Statements created with Database.query are finalized immediately. With throwOnError unset or false, statements created with Database.prepare keep working until they are finalized or garbage collected, and the underlying connection is released after the last one (sqlite3_close_v2). With throwOnError: true, every outstanding statement is finalized, the connection is released immediately (sqlite3_close), and an error is thrown if SQLite fails to close it.
It is safe to call this method multiple times. If the database is already closed, this is a no-op. Creating new statements after close throws; using a statement that close finalized throws Database has closed, except toString(), which returns an empty string, and finalize(), which stays safe to call.
If true, finalize every outstanding statement and throw if the connection fails to close
db.close();If a Database is garbage collected without being closed, the connection is released once every statement created from it has also been finalized or collected. using db = ... calls close(true).