Commit bad9339d by Daniel Cohen Gindi Committed by Kewde

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

parent ae93b501
...@@ -99,6 +99,17 @@ This uses the npm_config_python config, so values in .npmrc will be honoured: ...@@ -99,6 +99,17 @@ This uses the npm_config_python config, so values in .npmrc will be honoured:
python=/usr/bin/python2 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 ## 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). Because of ABI differences, `sqlite3` must be built in a custom to be used with [node-webkit](https://github.com/rogerwang/node-webkit).
......
{ {
'includes': [ 'common-sqlite.gypi' ], 'includes': [ 'common-sqlite.gypi' ],
'variables': {
'sqlite_magic%': '',
},
'target_defaults': { 'target_defaults': {
'default_configuration': 'Release', 'default_configuration': 'Release',
'cflags':[ 'cflags':[
...@@ -101,7 +106,14 @@ ...@@ -101,7 +106,14 @@
], ],
'export_dependent_settings': [ 'export_dependent_settings': [
'action_before_build', 'action_before_build',
],
'conditions': [
["sqlite_magic != ''", {
'defines': [
'SQLITE_FILE_HEADER="<(sqlite_magic)"'
] ]
}]
],
} }
] ]
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment