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
6fa2200c
Commit
6fa2200c
authored
Mar 03, 2010
by
Orlando Vazquez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No need to pass sqlite3** explicitly in `struct open_request`
We can pull it out of the top-level Database object.
parent
63893a9e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
12 deletions
+5
-12
sqlite3_bindings.cc
sqlite3_bindings.cc
+5
-8
test2.js
test2.js
+0
-4
No files found.
sqlite3_bindings.cc
View file @
6fa2200c
...
@@ -123,7 +123,6 @@ protected:
...
@@ -123,7 +123,6 @@ protected:
struct
open_request
{
struct
open_request
{
Persistent
<
Function
>
cb
;
Persistent
<
Function
>
cb
;
Sqlite3Db
*
dbo
;
Sqlite3Db
*
dbo
;
sqlite3
**
dbptr
;
char
filename
[
1
];
char
filename
[
1
];
};
};
...
@@ -133,7 +132,6 @@ protected:
...
@@ -133,7 +132,6 @@ protected:
struct
open_request
*
open_req
=
(
struct
open_request
*
)(
req
->
data
);
struct
open_request
*
open_req
=
(
struct
open_request
*
)(
req
->
data
);
printf
(
"EIO_AfterOpen; rc = %d
\n
"
,
(
int
)
req
->
result
);
printf
(
"EIO_AfterOpen; rc = %d
\n
"
,
(
int
)
req
->
result
);
printf
(
"result was %d
\n
"
,
(
int
)
req
->
result
);
printf
(
"result was %d
\n
"
,
(
int
)
req
->
result
);
Local
<
Value
>
argv
[
1
];
Local
<
Value
>
argv
[
1
];
...
@@ -161,11 +159,12 @@ protected:
...
@@ -161,11 +159,12 @@ protected:
struct
open_request
*
open_req
=
(
struct
open_request
*
)(
req
->
data
);
struct
open_request
*
open_req
=
(
struct
open_request
*
)(
req
->
data
);
printf
(
"The filename was %s
\n
"
,
open_req
->
filename
);
printf
(
"The filename was %s
\n
"
,
open_req
->
filename
);
printf
(
"before assn %p
\n
"
,
*
(
open_req
->
dbptr
));
sqlite3
**
dbptr
=
open_req
->
dbo
->
GetDBPtr
();
int
rc
=
sqlite3_open
(
open_req
->
filename
,
open_req
->
dbptr
);
printf
(
"before assn %p
\n
"
,
*
dbptr
);
printf
(
"after addr %p
\n
"
,
*
(
open_req
->
dbptr
));
int
rc
=
sqlite3_open
(
open_req
->
filename
,
dbptr
);
printf
(
"after assn %p
\n
"
,
*
dbptr
);
sqlite3
*
db
=
*
(
open_req
->
dbptr
)
;
sqlite3
*
db
=
*
dbptr
;
sqlite3_commit_hook
(
db
,
CommitHook
,
open_req
->
dbo
);
sqlite3_commit_hook
(
db
,
CommitHook
,
open_req
->
dbo
);
sqlite3_rollback_hook
(
db
,
RollbackHook
,
open_req
->
dbo
);
sqlite3_rollback_hook
(
db
,
RollbackHook
,
open_req
->
dbo
);
sqlite3_update_hook
(
db
,
UpdateHook
,
open_req
->
dbo
);
sqlite3_update_hook
(
db
,
UpdateHook
,
open_req
->
dbo
);
...
@@ -203,8 +202,6 @@ protected:
...
@@ -203,8 +202,6 @@ protected:
String
::
New
(
"Could not allocate enough memory"
)));
String
::
New
(
"Could not allocate enough memory"
)));
}
}
open_req
->
dbptr
=
dbo
->
GetDBPtr
();
strcpy
(
open_req
->
filename
,
*
filename
);
strcpy
(
open_req
->
filename
,
*
filename
);
open_req
->
cb
=
Persistent
<
Function
>::
New
(
cb
);
open_req
->
cb
=
Persistent
<
Function
>::
New
(
cb
);
open_req
->
dbo
=
dbo
;
open_req
->
dbo
=
dbo
;
...
...
test2.js
View file @
6fa2200c
...
@@ -14,10 +14,6 @@ throws(function () {
...
@@ -14,10 +14,6 @@ throws(function () {
db
.
open
(
"my.db"
);
db
.
open
(
"my.db"
);
});
});
throws
(
function
()
{
db
.
open
(
"/tmp"
);
});
db
.
open
(
"my.db"
,
function
(
err
)
{
db
.
open
(
"my.db"
,
function
(
err
)
{
puts
(
inspect
(
arguments
));
puts
(
inspect
(
arguments
));
if
(
err
)
{
if
(
err
)
{
...
...
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