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
41183e55
Commit
41183e55
authored
Feb 23, 2011
by
Konstantin Käfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make compatible with g++
parent
57bcffb3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
66 deletions
+66
-66
database.h
src/database.h
+2
-2
macros.h
src/macros.h
+5
-5
statement.cc
src/statement.cc
+42
-42
statement.h
src/statement.h
+17
-17
No files found.
src/database.h
View file @
41183e55
...
...
@@ -29,7 +29,7 @@ public:
return
constructor_template
->
HasInstance
(
obj
);
}
st
atic
st
ruct
Baton
{
struct
Baton
{
Database
*
db
;
Persistent
<
Function
>
callback
;
int
status
;
...
...
@@ -47,7 +47,7 @@ public:
}
};
st
atic
st
ruct
OpenBaton
:
Baton
{
struct
OpenBaton
:
Baton
{
std
::
string
filename
;
int
mode
;
...
...
src/macros.h
View file @
41183e55
...
...
@@ -158,11 +158,11 @@ const char* sqlite_code_string(int code);
#define DELETE_FIELD(field) \
switch ((field)->type) { \
case SQLITE_INTEGER: delete (
Data::Integer*)(field); break;
\
case SQLITE_FLOAT: delete (
Data::Float*)(field); break;
\
case SQLITE_TEXT: delete (
Data::Text*)(field); break;
\
case SQLITE_BLOB: delete (
Data::Blob*)(field); break;
\
case SQLITE_NULL: delete (
Data::Null*)(field); break;
\
case SQLITE_INTEGER: delete (
Values::Integer*)(field); break;
\
case SQLITE_FLOAT: delete (
Values::Float*)(field); break;
\
case SQLITE_TEXT: delete (
Values::Text*)(field); break;
\
case SQLITE_BLOB: delete (
Values::Blob*)(field); break;
\
case SQLITE_NULL: delete (
Values::Null*)(field); break;
\
}
#endif
...
...
src/statement.cc
View file @
41183e55
This diff is collapsed.
Click to expand it.
src/statement.h
View file @
41183e55
...
...
@@ -19,7 +19,7 @@ using namespace node;
namespace
node_sqlite3
{
namespace
Data
{
namespace
Values
{
struct
Field
{
inline
Field
(
unsigned
short
_index
,
unsigned
short
_type
=
SQLITE_NULL
)
:
type
(
_type
),
index
(
_index
)
{}
...
...
@@ -63,11 +63,11 @@ namespace Data {
};
typedef
Field
Null
;
typedef
std
::
vector
<
Field
*>
Row
;
typedef
std
::
vector
<
Row
*>
Rows
;
typedef
Row
Parameters
;
}
typedef
std
::
vector
<
Values
::
Field
*>
Row
;
typedef
std
::
vector
<
Row
*>
Rows
;
typedef
Row
Parameters
;
...
...
@@ -78,10 +78,10 @@ public:
static
void
Init
(
Handle
<
Object
>
target
);
static
Handle
<
Value
>
New
(
const
Arguments
&
args
);
st
atic
st
ruct
Baton
{
struct
Baton
{
Statement
*
stmt
;
Persistent
<
Function
>
callback
;
Data
::
Parameters
parameters
;
Parameters
parameters
;
Baton
(
Statement
*
stmt_
,
Handle
<
Function
>
cb_
)
:
stmt
(
stmt_
)
{
stmt
->
Ref
();
...
...
@@ -95,26 +95,26 @@ public:
}
};
st
atic
st
ruct
RowBaton
:
Baton
{
struct
RowBaton
:
Baton
{
RowBaton
(
Statement
*
stmt_
,
Handle
<
Function
>
cb_
)
:
Baton
(
stmt_
,
cb_
)
{}
Data
::
Row
row
;
Row
row
;
};
st
atic
st
ruct
RunBaton
:
Baton
{
struct
RunBaton
:
Baton
{
RunBaton
(
Statement
*
stmt_
,
Handle
<
Function
>
cb_
)
:
Baton
(
stmt_
,
cb_
),
inserted_id
(
0
),
changes
(
0
)
{}
sqlite3_int64
inserted_id
;
int
changes
;
};
st
atic
st
ruct
RowsBaton
:
Baton
{
struct
RowsBaton
:
Baton
{
RowsBaton
(
Statement
*
stmt_
,
Handle
<
Function
>
cb_
)
:
Baton
(
stmt_
,
cb_
)
{}
Data
::
Rows
rows
;
Rows
rows
;
};
st
atic
st
ruct
PrepareBaton
:
Database
::
Baton
{
struct
PrepareBaton
:
Database
::
Baton
{
Statement
*
stmt
;
std
::
string
sql
;
PrepareBaton
(
Database
*
db_
,
Handle
<
Function
>
cb_
,
Statement
*
stmt_
)
:
...
...
@@ -139,7 +139,7 @@ public:
struct
Async
{
ev_async
watcher
;
Statement
*
stmt
;
Data
::
Rows
data
;
Rows
data
;
pthread_mutex_t
mutex
;
Persistent
<
Function
>
callback
;
bool
completed
;
...
...
@@ -194,12 +194,12 @@ protected:
static
void
Finalize
(
Baton
*
baton
);
void
Finalize
();
template
<
class
T
>
inline
Data
::
Field
*
BindParameter
(
const
Handle
<
Value
>
source
,
T
pos
);
template
<
class
T
>
inline
Values
::
Field
*
BindParameter
(
const
Handle
<
Value
>
source
,
T
pos
);
template
<
class
T
>
T
*
Bind
(
const
Arguments
&
args
,
int
start
=
0
);
bool
Bind
(
const
Data
::
Parameters
parameters
);
bool
Bind
(
const
Parameters
parameters
);
static
void
GetRow
(
Data
::
Row
*
row
,
sqlite3_stmt
*
stmt
);
static
Local
<
Object
>
RowToJS
(
Data
::
Row
*
row
);
static
void
GetRow
(
Row
*
row
,
sqlite3_stmt
*
stmt
);
static
Local
<
Object
>
RowToJS
(
Row
*
row
);
void
Schedule
(
EIO_Callback
callback
,
Baton
*
baton
);
void
Process
();
void
CleanQueue
();
...
...
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