Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom magic to be specified through --sqlite_magic #1144

Merged
merged 1 commit into from
Aug 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ This uses the npm_config_python config, so values in .npmrc will be honoured:

python=/usr/bin/python2

## Custom file header (magic)

The default sqlite file header is "SQLite format 3".
You can specify a different magic, though this will make standard tools and libraries unable to work with your files.


npm install --build-from-source --sqlite_magic="MyCustomMagic15"


Note that the magic *must* be exactly 15 characters long (16 bytes including null terminator).

## Building for node-webkit

Because of ABI differences, `sqlite3` must be built in a custom to be used with [node-webkit](https://github.com/rogerwang/node-webkit).
Expand Down
14 changes: 13 additions & 1 deletion deps/sqlite3.gyp
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
'includes': [ 'common-sqlite.gypi' ],

'variables': {
'sqlite_magic%': '',
},

'target_defaults': {
'default_configuration': 'Release',
'cflags':[
Expand Down Expand Up @@ -101,7 +106,14 @@
],
'export_dependent_settings': [
'action_before_build',
]
],
'conditions': [
["sqlite_magic != ''", {
'defines': [
'SQLITE_FILE_HEADER="<(sqlite_magic)"'
]
}]
],
}
]
}