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
4bd8a1fe
Commit
4bd8a1fe
authored
9 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Implemeneted SqliteCatalogue::createStorageClass()
parent
56f9aaef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
catalogue/SqliteCatalogue.cpp
+64
-0
64 additions, 0 deletions
catalogue/SqliteCatalogue.cpp
with
64 additions
and
0 deletions
catalogue/SqliteCatalogue.cpp
+
64
−
0
View file @
4bd8a1fe
...
...
@@ -70,6 +70,25 @@ void cta::catalogue::SqliteCatalogue::createDbSchema() {
"LAST_MOD_TIME INTEGER,"
"PRIMARY KEY(HOST_NAME)"
");"
"CREATE TABLE STORAGE_CLASS("
"STORAGE_CLASS_NAME TEXT,"
"NB_FILES INTEGER,"
"COMMENT TEXT,"
"CREATION_LOG_USER_NAME TEXT,"
"CREATION_LOG_GROUP_NAME TEXT,"
"CREATION_LOG_HOST_NAME TEXT,"
"CREATION_LOG_TIME INTEGER,"
"LAST_MOD_USER_NAME TEXT,"
"LAST_MOD_GROUP_NAME TEXT,"
"LAST_MOD_HOST_NAME TEXT,"
"LAST_MOD_TIME INTEGER,"
"PRIMARY KEY(STORAGE_CLASS_NAME)"
");"
;
m_conn
.
enableForeignKeys
();
m_conn
.
execNonQuery
(
sql
);
...
...
@@ -392,6 +411,51 @@ void cta::catalogue::SqliteCatalogue::createStorageClass(
const
std
::
string
&
name
,
const
uint64_t
nbCopies
,
const
std
::
string
&
comment
)
{
const
time_t
now
=
time
(
NULL
);
const
char
*
const
sql
=
"INSERT INTO STORAGE_CLASS("
"STORAGE_CLASS_NAME,"
"NB_FILES,"
"COMMENT,"
"CREATION_LOG_USER_NAME,"
"CREATION_LOG_GROUP_NAME,"
"CREATION_LOG_HOST_NAME,"
"CREATION_LOG_TIME,"
"LAST_MOD_USER_NAME,"
"LAST_MOD_GROUP_NAME,"
"LAST_MOD_HOST_NAME,"
"LAST_MOD_TIME)"
"VALUES("
":STORAGE_CLASS_NAME,"
":NB_FILES,"
":COMMENT,"
":CREATION_LOG_USER_NAME,"
":CREATION_LOG_GROUP_NAME,"
":CREATION_LOG_HOST_NAME,"
":CREATION_LOG_TIME,"
":CREATION_LOG_USER_NAME,"
":CREATION_LOG_GROUP_NAME,"
":CREATION_LOG_HOST_NAME,"
":CREATION_LOG_TIME);"
;
SqliteStmt
stmt
(
m_conn
,
sql
);
stmt
.
bind
(
":STORAGE_CLASS_NAME"
,
name
);
stmt
.
bind
(
":NB_FILES"
,
nbCopies
);
stmt
.
bind
(
":COMMENT"
,
comment
);
stmt
.
bind
(
":CREATION_LOG_USER_NAME"
,
cliIdentity
.
user
.
name
);
stmt
.
bind
(
":CREATION_LOG_GROUP_NAME"
,
cliIdentity
.
user
.
group
);
stmt
.
bind
(
":CREATION_LOG_HOST_NAME"
,
cliIdentity
.
host
);
stmt
.
bind
(
":CREATION_LOG_TIME"
,
now
);
stmt
.
step
();
}
//------------------------------------------------------------------------------
...
...
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