Client APIs
Prepared Statements
From connections, you can create prepared statements (and only that) using `con.prepare()`:  
```js
const stmt = con.prepare('SELECT ?::INTEGER AS fortytwo');
```  
To execute this statement, you can call for example `all()` on the `stmt` object:  
```js
stmt.all(42, function(err, res) {
if (err) {
console.warn(err);
} else {
console.log(res[0].fortytwo)
}
});
```  
You can also execute the prepared statement multiple times. This is for example useful to fill a table with data:  
```js
con.run('CREATE TABLE a (i INTEGER)');
const stmt = con.prepare('INSERT INTO a VALUES (?)');
for (let i = 0; i < 10; i++) {
stmt.run(i);
}
stmt.finalize();
con.all('SELECT * FROM a', function(err, res) {
if (err) {
console.warn(err);
} else {
console.log(res)
}
});
```  
`prepare()` can also take a callback which gets the prepared statement as an argument:  
```js
const stmt = con.prepare('SELECT ?::INTEGER AS fortytwo', function(err, stmt) {
stmt.all(42, function(err, res) {
if (err) {
console.warn(err);
} else {
console.log(res[0].fortytwo)
}
});
});
```