Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
db567ad0
Commit
db567ad0
authored
8 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Simplified the public interface of SqliteConn
parent
9c2de5ab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
catalogue/SqliteConn.cpp
+1
-12
1 addition, 12 deletions
catalogue/SqliteConn.cpp
catalogue/SqliteConn.hpp
+8
-13
8 additions, 13 deletions
catalogue/SqliteConn.hpp
with
9 additions
and
25 deletions
catalogue/SqliteConn.cpp
+
1
−
12
View file @
db567ad0
...
...
@@ -85,7 +85,7 @@ DbStmt *SqliteConn::createStmt(const std::string &sql) {
//------------------------------------------------------------------------------
void
SqliteConn
::
createCatalogueDatabaseSchema
()
{
try
{
e
nableF
oreign
K
eys
(
);
e
xecMultiLineNonQuery
(
"PRAGMA f
oreign
_k
eys
= ON;"
);
const
RdbmsCatalogueSchema
schema
;
execMultiLineNonQuery
(
schema
.
sql
);
}
catch
(
exception
::
Exception
&
ex
)
{
...
...
@@ -93,17 +93,6 @@ void SqliteConn::createCatalogueDatabaseSchema() {
}
}
//------------------------------------------------------------------------------
// enableForeignKeys
//------------------------------------------------------------------------------
void
SqliteConn
::
enableForeignKeys
()
{
try
{
execMultiLineNonQuery
(
"PRAGMA foreign_keys = ON;"
);
}
catch
(
exception
::
Exception
&
ex
)
{
throw
exception
::
Exception
(
std
::
string
(
__FUNCTION__
)
+
" failed: "
+
ex
.
getMessage
().
str
());
}
}
//------------------------------------------------------------------------------
// executeMultiLineNonQuery
//------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
catalogue/SqliteConn.hpp
+
8
−
13
View file @
db567ad0
...
...
@@ -69,19 +69,6 @@ public:
*/
void
createCatalogueDatabaseSchema
();
/**
* This is an SqliteConn specific method that enables foreign key constraints.
*/
void
enableForeignKeys
();
/**
* This is an SqliteConn specific method that executes the specified
* multi-line non-query SQL statement.
*
* @param sql The SQL statement.
*/
void
execMultiLineNonQuery
(
const
std
::
string
&
sql
);
/**
* This ia an SqliteConn specific method that prints the database schema to
* the specified output stream.
...
...
@@ -105,6 +92,14 @@ private:
*/
sqlite3
*
m_conn
;
/**
* This is an SqliteConn specific method that executes the specified
* multi-line non-query SQL statement.
*
* @param sql The SQL statement.
*/
void
execMultiLineNonQuery
(
const
std
::
string
&
sql
);
};
// class SqliteConn
}
// namespace catalogue
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment