Skip to content

Commit

Permalink
cleaned up repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Wise committed Sep 7, 2016
1 parent 3edefdc commit 0069de9
Show file tree
Hide file tree
Showing 73 changed files with 177 additions and 2,329 deletions.
55 changes: 35 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
*.dylib
*.so
*.o
*.lo
*.Makefile
*.target.gyp.mk
lib/binding
build
out
Release
Debug
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/

# Dependency directory
node_modules
.deps
Makefile.gyp
gyp-mac-tool
.dirstamp
npm-debug.log
test/support/big.db
test/tmp
test/nw/app.nw

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Project specific
lib/binding
.DS_Store
.idea
12 changes: 0 additions & 12 deletions .npmignore

This file was deleted.

49 changes: 5 additions & 44 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
This project is a fork of node-sqlite3 (https://github.com/mapbox/node-sqlite3).
As such, copyright for portions of this project are held by MapBox as part of
node-sqlite3, under "The BSD-3-Clause License". All other copyright for this
project are held by Joshua Wise, under "The MIT License".



The MIT License
===============
The MIT License (MIT)

Copyright (c) 2016 Joshua Wise

Expand All @@ -17,44 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.



The BSD-3-Clause License
===============

Copyright (c) MapBox
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
- Neither the name "MapBox" nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
30 changes: 6 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,33 @@
# sqlite3-plus
# better-sqlite3

*You want [Node](http://nodejs.org/)?*

*You want [Sqlite](http://sqlite.org/)?*

*You want your life to be* **easy?**

##### **Well you're in luck because sqlite3-plus is here!!!!**
##### **Well you're in luck because better-sqlite3 is here!!!!**

## Installation

```bash
npm install --save sqlite3-plus
npm install --save better-sqlite3
```

## Usage

```js
var sql = require('sqlite3-plus').verbose();
var db = new sql.Database(':memory:');
var Database = require('better-sqlite3');
var db = new Database('foobar.db', {memory: true, wal: false});
```

The `statement.pluck()` method will return the wrong data if the specified column's position in the table changes (by dropping and recreating the table).

## Features

- Full transaction support
- Full Buffer/Blob support
- Big test suite
- Written in modern C++ and tested for memory leaks

# Contributors

* [Konstantin Käfer](https://github.com/kkaefer)
* [Dane Springmeyer](https://github.com/springmeyer)
* [Will White](https://github.com/willwhite)
* [Orlando Vazquez](https://github.com/orlandov)
* [Artem Kustikov](https://github.com/artiz)
* [Eric Fredricksen](https://github.com/grumdrig)
* [John Wright](https://github.com/mrjjwright)
* [Ryan Dahl](https://github.com/ry)
* [Tom MacWright](https://github.com/tmcw)
* [Carter Thaxton](https://github.com/carter-thaxton)
* [Audrius Kažukauskas](https://github.com/audriusk)
* [Johannes Schauer](https://github.com/pyneo)
* [Mithgol](https://github.com/Mithgol)

# License

[BSD and MIT licensed](https://github.com/JoshuaWise/node-sqlite3-plus/blob/master/LICENSE.md).
[MIT](https://github.com/JoshuaWise/better-sqlite3/blob/master/LICENSE.md).
8 changes: 5 additions & 3 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---------- Polish ----------
investigate BEGIN IMMEDIATE as an alternative to mutexes
(if we dont need sqlite3_last_insert_rowid or sqlite3_changes, do we get a performance boost?)

use SQLITE_ENABLE_API_ARMOR compilation option while developing

add db method for setting pragma on both connections, synchronously

think of a way to deal with 64bit integers

---------- Package ----------
deal with ./test/ and .travis.yml
compare tests with node-sqlite3


---------- Executable ----------
Expand Down
6 changes: 3 additions & 3 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"includes": [ "deps/common-sqlite.gypi" ],
"includes": [ "deps/common.gypi" ],
"targets": [
{
"target_name": "sqlite3_plus",
"target_name": "better_sqlite3",
"include_dirs": ["<!(node -e \"require('nan')\")"],
"dependencies": [
"deps/sqlite3.gyp:sqlite3"
Expand Down Expand Up @@ -30,7 +30,7 @@
"src/workers/transaction-worker.cc",
"src/binder/binder.cc",
"src/multi-binder/multi-binder.cc",
"src/sqlite3_plus.cc"
"src/better_sqlite3.cc"
]
}
]
Expand Down
File renamed without changes.
15 changes: 3 additions & 12 deletions deps/sqlite3.gyp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
'includes': [ 'common-sqlite.gypi' ],
'includes': [ 'common.gypi' ],
'target_defaults': {
'default_configuration': 'Release',
'cflags': [
'-std=c99'
],
'configurations': {
'Debug': {
'defines': [ 'DEBUG', '_DEBUG' ],
'defines': [ 'DEBUG', '_DEBUG', 'SQLITE_ENABLE_API_ARMOR'],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
Expand Down Expand Up @@ -75,16 +75,7 @@
'<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/sqlite3.c'
],
'direct_dependent_settings': {
'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/' ],
'defines': [
'SQLITE_THREADSAFE=1',
'SQLITE_ENABLE_FTS3',
'SQLITE_ENABLE_JSON1',
'SQLITE_ENABLE_RTREE',
'SQLITE_DEFAULT_CACHE_SIZE=16000',
'SQLITE_DEFAULT_FOREIGN_KEYS=1',
'SQLITE_USE_URI=1'
],
'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/' ]
},
'cflags_cc': [
'-Wno-unused-value',
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use strict';
module.exports = require('./lib/database');
7 changes: 3 additions & 4 deletions lib/database.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict';
var EventEmitter = require('events').EventEmitter;
var toDescriptor = require('to-descriptor');
var CPPDatabase = require('bindings')('sqlite3_plus').Database;
var setPrototypeOf = require('./set-prototype-of');
var CPPDatabase = require('bindings')('better_sqlite3').Database;

function Database(filename, options) {
if (typeof filename !== 'string') {
Expand Down Expand Up @@ -40,8 +39,8 @@ function Database(filename, options) {
}
CPPDatabase.prototype.constructor = Database;
Database.prototype = Object.create(Object.prototype, toDescriptor(CPPDatabase.prototype));
setPrototypeOf(Database.prototype, EventEmitter.prototype);
setPrototypeOf(CPPDatabase.prototype, Database.prototype);
Object.setPrototypeOf(Database.prototype, EventEmitter.prototype);
Object.setPrototypeOf(CPPDatabase.prototype, Database.prototype);
module.exports = Database;

function NullFactory() {}
Expand Down
10 changes: 0 additions & 10 deletions lib/set-prototype-of.js

This file was deleted.

16 changes: 0 additions & 16 deletions lib/sqlite3-plus.js

This file was deleted.

42 changes: 0 additions & 42 deletions lib/trace.js

This file was deleted.

Loading

0 comments on commit 0069de9

Please sign in to comment.