Skip to content
GitLab
探索
项目
群组
代码片段
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录
切换导航
菜单
打开侧边栏
ExternalRepo
sqlite3pp
提交
9a594a62
提交
9a594a62
编辑于
9年前
作者:
Wongoo Lee
浏览文件
操作
下载
电子邮件补丁
差异文件
Make dtors not throw exceptions. (src dir).
上级
aa23baaf
master
1.0.5
v1.0.9
v1.0.8
v1.0.7
v1.0.6
v1.0.4
无相关合并请求
变更
2
Hide whitespace changes
Inline
Side-by-side
显示
2 个更改的文件
src/sqlite3pp.cpp
+9
-8
src/sqlite3pp.cpp
src/sqlite3pp.h
+2
-2
src/sqlite3pp.h
有
11 个添加
和
10 个删除
+11
-10
src/sqlite3pp.cpp
+
9
-
8
浏览文件 @
9a594a62
...
...
@@ -234,11 +234,11 @@ namespace sqlite3pp
}
}
statement
::~
statement
()
noexcept
(
false
)
statement
::~
statement
()
{
auto
rc
=
finish
();
if
(
rc
!=
SQLITE_OK
)
throw
database_error
(
db_
);
// finish() can return error. If you want to check the error, call
// finish() explicitly before this object is destructed.
finish
(
);
}
int
statement
::
prepare
(
char
const
*
stmt
)
...
...
@@ -551,12 +551,13 @@ namespace sqlite3pp
throw
database_error
(
*
db_
);
}
transaction
::~
transaction
()
noexcept
(
false
)
transaction
::~
transaction
()
{
if
(
db_
)
{
auto
rc
=
db_
->
execute
(
fcommit_
?
"COMMIT"
:
"ROLLBACK"
);
if
(
rc
!=
SQLITE_OK
)
throw
database_error
(
*
db_
);
// execute() can return error. If you want to check the error,
// call commit() or rollback() explicitly before this object is
// destructed.
db_
->
execute
(
fcommit_
?
"COMMIT"
:
"ROLLBACK"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/sqlite3pp.h
+
2
-
2
浏览文件 @
9a594a62
...
...
@@ -164,7 +164,7 @@ namespace sqlite3pp
protected:
explicit
statement
(
database
&
db
,
char
const
*
stmt
=
nullptr
);
~
statement
()
noexcept
(
false
)
;
~
statement
();
int
prepare_impl
(
char
const
*
stmt
);
int
finish_impl
(
sqlite3_stmt
*
stmt
);
...
...
@@ -312,7 +312,7 @@ namespace sqlite3pp
{
public:
explicit
transaction
(
database
&
db
,
bool
fcommit
=
false
,
bool
freserve
=
false
);
~
transaction
()
noexcept
(
false
)
;
~
transaction
();
int
commit
();
int
rollback
();
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
菜单
探索
项目
群组
代码片段