From a234d1053a5de82fca9cae500639813e9eed5cd5 Mon Sep 17 00:00:00 2001 From: David Pratten Date: Sat, 30 Jan 2021 07:02:39 +1100 Subject: [PATCH 1/3] Update api.js to improve documentation To resolve https://github.com/sql-js/sql.js/issues/435 --- src/api.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api.js b/src/api.js index 62fb8dea..e87b8be9 100644 --- a/src/api.js +++ b/src/api.js @@ -239,8 +239,12 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() { * You can't instantiate this class directly, you have to use a * {@link Database} object in order to create a statement. * - * **Warning**: When you close a database (using db.close()), - * all its statements are closed too and become unusable. + * **Warnings**: + * 1. When you close a database (using db.close()), all + * its statements are closed too and become unusable. + * 2. After calling db.prepare() you must manually free the assigned memory + * by calling Statement.free(). Failure to do this will cause subsequent 'DROP TABLE ...' + * statements to fail with 'Uncaught Error: database table is locked'. * * Statements can't be created by the API user directly, only by * Database::prepare From 0f466d917c8a4b2013babfcd09b4c3aa01e1debc Mon Sep 17 00:00:00 2001 From: David Pratten Date: Sat, 30 Jan 2021 08:14:14 +1100 Subject: [PATCH 2/3] Fix formatting Issues 1 --- src/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api.js b/src/api.js index e87b8be9..88d0185b 100644 --- a/src/api.js +++ b/src/api.js @@ -239,10 +239,10 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() { * You can't instantiate this class directly, you have to use a * {@link Database} object in order to create a statement. * - * **Warnings**: + * **Warnings** * 1. When you close a database (using db.close()), all * its statements are closed too and become unusable. - * 2. After calling db.prepare() you must manually free the assigned memory + * 1. After calling db.prepare() you must manually free the assigned memory * by calling Statement.free(). Failure to do this will cause subsequent 'DROP TABLE ...' * statements to fail with 'Uncaught Error: database table is locked'. * From 024dd653abf963927629df100e6360b0ad107dca Mon Sep 17 00:00:00 2001 From: David Pratten Date: Sat, 30 Jan 2021 08:22:37 +1100 Subject: [PATCH 3/3] Fix formatting Issues 2 --- src/api.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api.js b/src/api.js index 88d0185b..52bbab58 100644 --- a/src/api.js +++ b/src/api.js @@ -239,12 +239,13 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() { * You can't instantiate this class directly, you have to use a * {@link Database} object in order to create a statement. * - * **Warnings** + * **Warnings** * 1. When you close a database (using db.close()), all * its statements are closed too and become unusable. * 1. After calling db.prepare() you must manually free the assigned memory - * by calling Statement.free(). Failure to do this will cause subsequent 'DROP TABLE ...' - * statements to fail with 'Uncaught Error: database table is locked'. + * by calling Statement.free(). Failure to do this will cause subsequent + * 'DROP TABLE ...' statements to fail with 'Uncaught Error: database table + * is locked'. * * Statements can't be created by the API user directly, only by * Database::prepare