GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Control Flow
This repository was archived by the owner on Jul 1, 2026. It is now read-only.
Control Flow
Alex Tan edited this page
Puts the execution mode into serialized. This means that at most one statement object can execute a query at a time. Other statements wait in a queue until the previous statements are executed. If a callback is provided, it will be called immediately. All database queries scheduled in that callback will be serialized. After the function returns, the database is set back to its original mode again. Calling // Queries scheduled here will run in parallel. db.serialize(function() { // Queries scheduled here will be serialized. db.serialize(function() { // Queries scheduled here will still be serialized. }); // Queries scheduled here will still be serialized. }); // Queries scheduled here will run in parallel again. Note that queries scheduled not directly in the callback function are not necessarily serialized: db.serialize(function() { // These two queries will run sequentially. db.run("CREATE TABLE foo (num)"); db.run("INSERT INTO foo VALUES (?)", 1, function() { // These queries will run in parallel and the second query will probably // fail because the table might not exist yet. db.run("CREATE TABLE bar (num)"); db.run("INSERT INTO bar VALUES (?)", 1); }); }); If you call it without a function parameter, the execution mode setting is sticky and won't change until the next call to Puts the execution mode into parallelized. This means that queries scheduled will be run in parallel. If a callback is provided, it will be called immediately. All database queries scheduled in that callback will run parallelized. After the function returns, the database is set back to its original mode again. Calling db.serialize(function() { // Queries scheduled here will be serialized. db.parallelize(function() { // Queries scheduled here will run in parallel. }); // Queries scheduled here will be serialized again. }); If you call it without a function parameter, the execution mode setting is sticky and won't change until the next call to Clone this wiki locally |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |