Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
postprocessing
Media Metadata Indexer
Commits
289ac3ce
Unverified
Commit
289ac3ce
authored
Dec 18, 2020
by
Sebastian Schüpbach
Browse files
log sql statement parameters
Signed-off-by:
Sebastian Schüpbach
<
sebastian.schuepbach@unibas.ch
>
parent
e34b041d
Pipeline
#19206
passed with stages
in 2 minutes and 7 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
mediametadatatodb_app/resources/indexer.py
View file @
289ac3ce
...
...
@@ -55,17 +55,18 @@ class Indexer:
"""
Insert record in DB
"""
entities_stmt
,
entities_
values
=
Indexer
.
_create_sql_stmt
(
'entities'
,
record
,
stmt
,
values
=
Indexer
.
_create_sql_stmt
(
'entities'
,
record
,
[
'sig'
,
'uri'
,
'access'
,
'proto'
])
metadata_stmt
,
metadata_values
=
Indexer
.
_create_sql_stmt
(
'metadata'
,
record
,
try
:
self
.
mariadb_cursor
.
execute
(
stmt
,
values
)
stmt
,
values
=
Indexer
.
_create_sql_stmt
(
'metadata'
,
record
,
[
'sig'
,
'mimetype'
,
'height'
,
'width'
,
'duration'
,
'type'
])
try
:
self
.
mariadb_cursor
.
execute
(
entities_stmt
,
entities_values
)
self
.
mariadb_cursor
.
execute
(
metadata_stmt
,
metadata_values
)
self
.
mariadb_cursor
.
execute
(
stmt
,
values
)
return
True
,
""
except
mariadb
.
Error
as
ex
:
logging
.
error
(
f
"Problems in sql statement (
{
entities_stmt
}
):
{
ex
}
"
)
logging
.
error
(
f
'Problems in sql statement (statement: "
{
stmt
}
", '
f
'parameters:
{
values
}
):
{
ex
}
'
)
return
False
,
str
(
ex
)
def
commit
(
self
):
...
...
Write
Preview
Supports
Markdown
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