Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sqlite3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
node-sqlite3
Commits
f89fa7e3
Commit
f89fa7e3
authored
Jul 04, 2010
by
Orlando Vazquez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename the Sqlite3Db class to Database, and move it to its own file
parent
f7cb2ad2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
61 deletions
+50
-61
README.md
README.md
+2
-4
sqlite3_bindings.cc
src/sqlite3_bindings.cc
+0
-0
sqlite3_bindings.h
src/sqlite3_bindings.h
+0
-8
statement.h
src/statement.h
+47
-48
wscript
wscript
+1
-1
No files found.
README.md
View file @
f89fa7e3
...
@@ -131,8 +131,8 @@ Ryan Dahl [ry@tinyclouds.org]
...
@@ -131,8 +131,8 @@ Ryan Dahl [ry@tinyclouds.org]
THANKS
THANKS
------
------
Many thanks to Eric Fredricksen for his synchronous driver on which this
was
Many thanks to Eric Fredricksen for his synchronous driver on which this
based.
driver was originally
based.
*
http://github.com/grumdrig/node-sqlite/
*
http://github.com/grumdrig/node-sqlite/
*
http://grumdrig.com/node-sqlite/
*
http://grumdrig.com/node-sqlite/
...
@@ -142,6 +142,4 @@ LICENSE
...
@@ -142,6 +142,4 @@ LICENSE
node-sqlite is BSD licensed.
node-sqlite is BSD licensed.
(c) 2010 Eric Fredricksen
(c) 2010 Orlando Vazquez
(c) 2010 Orlando Vazquez
src/sqlite3_bindings.cc
View file @
f89fa7e3
This diff is collapsed.
Click to expand it.
src/sqlite3_bindings.h
View file @
f89fa7e3
...
@@ -58,12 +58,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
...
@@ -58,12 +58,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
return ThrowException(Exception::TypeError( \
return ThrowException(Exception::TypeError( \
String::New("Argument " #I " must be an integer"))); \
String::New("Argument " #I " must be an integer"))); \
}
}
enum
ExecMode
{
EXEC_EMPTY
=
0
,
EXEC_LAST_INSERT_ID
=
1
,
EXEC_AFFECTED_ROWS
=
2
};
#endif
#endif
src/statement.h
View file @
f89fa7e3
...
@@ -25,62 +25,61 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
...
@@ -25,62 +25,61 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
using
namespace
v8
;
using
namespace
v8
;
using
namespace
node
;
using
namespace
node
;
class
Statement
:
public
EventEmitter
{
class
Statement
:
public
EventEmitter
{
public
:
public
:
static
Persistent
<
FunctionTemplate
>
constructor_template
;
static
Persistent
<
FunctionTemplate
>
constructor_template
;
static
void
Init
(
v8
::
Handle
<
Object
>
target
);
static
void
Init
(
v8
::
Handle
<
Object
>
target
);
static
Handle
<
Value
>
New
(
const
Arguments
&
args
);
static
Handle
<
Value
>
New
(
const
Arguments
&
args
);
protected
:
protected
:
Statement
(
sqlite3_stmt
*
stmt
,
int
first_rc
=
-
1
)
Statement
(
sqlite3_stmt
*
stmt
,
int
first_rc
=
-
1
)
:
EventEmitter
(),
first_rc_
(
first_rc
),
stmt_
(
stmt
)
{
:
EventEmitter
(),
first_rc_
(
first_rc
),
stmt_
(
stmt
)
{
column_count_
=
-
1
;
column_count_
=
-
1
;
column_types_
=
NULL
;
column_types_
=
NULL
;
column_names_
=
NULL
;
column_names_
=
NULL
;
column_data_
=
NULL
;
column_data_
=
NULL
;
}
}
~
Statement
()
{
~
Statement
()
{
if
(
stmt_
)
sqlite3_finalize
(
stmt_
);
if
(
stmt_
)
sqlite3_finalize
(
stmt_
);
if
(
column_types_
)
free
(
column_types_
);
if
(
column_types_
)
free
(
column_types_
);
if
(
column_names_
)
free
(
column_names_
);
if
(
column_names_
)
free
(
column_names_
);
if
(
column_data_
)
FreeColumnData
();
if
(
column_data_
)
FreeColumnData
();
}
}
static
int
EIO_AfterBind
(
eio_req
*
req
);
static
int
EIO_AfterBind
(
eio_req
*
req
);
static
int
EIO_Bind
(
eio_req
*
req
);
static
int
EIO_Bind
(
eio_req
*
req
);
static
Handle
<
Value
>
Bind
(
const
Arguments
&
args
);
static
Handle
<
Value
>
Bind
(
const
Arguments
&
args
);
static
int
EIO_AfterFinalize
(
eio_req
*
req
);
static
int
EIO_AfterFinalize
(
eio_req
*
req
);
static
int
EIO_Finalize
(
eio_req
*
req
);
static
int
EIO_Finalize
(
eio_req
*
req
);
static
Handle
<
Value
>
Finalize
(
const
Arguments
&
args
);
static
Handle
<
Value
>
Finalize
(
const
Arguments
&
args
);
static
Handle
<
Value
>
Reset
(
const
Arguments
&
args
);
static
Handle
<
Value
>
Reset
(
const
Arguments
&
args
);
static
int
EIO_AfterStep
(
eio_req
*
req
);
static
int
EIO_AfterStep
(
eio_req
*
req
);
static
int
EIO_Step
(
eio_req
*
req
);
static
int
EIO_Step
(
eio_req
*
req
);
static
Handle
<
Value
>
Step
(
const
Arguments
&
args
);
static
Handle
<
Value
>
Step
(
const
Arguments
&
args
);
void
FreeColumnData
(
void
);
void
FreeColumnData
(
void
);
bool
HasCallback
();
bool
HasCallback
();
void
SetCallback
(
Local
<
Function
>
cb
);
void
SetCallback
(
Local
<
Function
>
cb
);
Local
<
Function
>
GetCallback
();
Local
<
Function
>
GetCallback
();
private
:
private
:
int
column_count_
;
int
*
column_types_
;
int
column_count_
;
char
**
column_names_
;
int
*
column_types_
;
void
**
column_data_
;
char
**
column_names_
;
bool
error_
;
void
**
column_data_
;
bool
error_
;
int
first_rc_
;
sqlite3_stmt
*
stmt_
;
int
first_rc_
;
sqlite3_stmt
*
stmt_
;
};
};
// indicates the key type (integer index or name string)
// indicates the key type (integer index or name string)
...
...
wscript
View file @
f89fa7e3
...
@@ -24,7 +24,7 @@ def build(bld):
...
@@ -24,7 +24,7 @@ def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall"]
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall"]
obj.target = "sqlite3_bindings"
obj.target = "sqlite3_bindings"
obj.source = "src/sqlite3_bindings.cc src/statement.cc"
obj.source = "src/sqlite3_bindings.cc src/
database.cc src/
statement.cc"
obj.uselib = "SQLITE3 PROFILER"
obj.uselib = "SQLITE3 PROFILER"
t = 'sqlite3_bindings.node'
t = 'sqlite3_bindings.node'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment