Skip to content

Commit

Permalink
Allow custom magic to be specified through --sqlite_magic (#1144)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgindi authored and kewde committed Aug 3, 2019
1 parent ae93b50 commit bad9339
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
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)"'
]
}]
],
}
]
}

0 comments on commit bad9339

Please sign in to comment.