-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from Mytherin/busytimeout
Add more options for opening SQLite databases - busy_timeout and journal_mode - and set busy time-out by default
- Loading branch information
Showing
9 changed files
with
93 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//===----------------------------------------------------------------------===// | ||
// DuckDB | ||
// | ||
// storage/sqlite_options.hpp | ||
// | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#pragma once | ||
|
||
#include "duckdb/common/common.hpp" | ||
#include "duckdb/common/enums/access_mode.hpp" | ||
|
||
namespace duckdb { | ||
|
||
struct SQLiteOpenOptions { | ||
// access mode | ||
AccessMode access_mode = AccessMode::READ_WRITE; | ||
// busy time-out in ms | ||
idx_t busy_timeout = 5000; | ||
// journal mode | ||
string journal_mode; | ||
}; | ||
|
||
|
||
} // namespace duckdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# name: test/sql/storage/attach_options.test | ||
# description: | ||
# group: [sqlite_storage] | ||
|
||
require sqlite_scanner | ||
|
||
statement error | ||
ATTACH ':memory:' AS mem (TYPE SQLITE, BUSY_TIMEOUT 'hello') | ||
---- | ||
Could not convert string | ||
|
||
statement error | ||
ATTACH ':memory:' AS mem (TYPE SQLITE, BUSY_TIMEOUT 99999999999) | ||
---- | ||
busy_timeout out of range | ||
|
||
statement ok | ||
ATTACH ':memory:' AS mem (TYPE SQLITE, BUSY_TIMEOUT 0) | ||
|
||
statement ok | ||
DETACH mem | ||
|
||
statement ok | ||
ATTACH ':memory:' AS mem (TYPE SQLITE, JOURNAL_MODE 'WAL') |