Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
hive
hivemind
Commits
e79bca4b
Commit
e79bca4b
authored
4 years ago
by
Dariusz Kędzierski
Browse files
Options
Downloads
Patches
Plain Diff
Merge fixes
parent
5a685202
No related branches found
No related tags found
5 merge requests
!456
Release candidate v1 24
,
!230
Setup monitoring with pghero
,
!135
Enable postgres monitoring on CI server
,
!16
Dk issue 3 concurrent block query rebase
,
!15
Dk issue 3 concurrent block query
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hive/db/adapter.py
+3
-0
3 additions, 0 deletions
hive/db/adapter.py
hive/db/schema.py
+2
-1
2 additions, 1 deletion
hive/db/schema.py
hive/indexer/posts.py
+2
-2
2 additions, 2 deletions
hive/indexer/posts.py
with
7 additions
and
3 deletions
hive/db/adapter.py
+
3
−
0
View file @
e79bca4b
...
@@ -78,6 +78,9 @@ class Db:
...
@@ -78,6 +78,9 @@ class Db:
assert
self
.
_is_write_query
(
sql
),
sql
assert
self
.
_is_write_query
(
sql
),
sql
return
self
.
_query
(
sql
,
**
kwargs
)
return
self
.
_query
(
sql
,
**
kwargs
)
def
query_no_return
(
self
,
sql
,
**
kwargs
):
self
.
_query
(
sql
,
**
kwargs
)
def
query_all
(
self
,
sql
,
**
kwargs
):
def
query_all
(
self
,
sql
,
**
kwargs
):
"""
Perform a `SELECT n*m`
"""
"""
Perform a `SELECT n*m`
"""
res
=
self
.
_query
(
sql
,
**
kwargs
)
res
=
self
.
_query
(
sql
,
**
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
hive/db/schema.py
+
2
−
1
View file @
e79bca4b
...
@@ -436,6 +436,7 @@ if _parent_author != '' THEN
...
@@ -436,6 +436,7 @@ if _parent_author != '' THEN
CASE
CASE
WHEN root_id=-1 THEN php.id
WHEN root_id=-1 THEN php.id
ELSE root_id
ELSE root_id
END
FROM hive_posts
FROM hive_posts
WHERE hive_posts.id=php.id
WHERE hive_posts.id=php.id
) as root_id,
) as root_id,
...
@@ -492,7 +493,7 @@ END IF;
...
@@ -492,7 +493,7 @@ END IF;
END
END
$function$
$function$
"""
"""
db
.
query_
row
(
sql
)
db
.
query_
no_return
(
sql
)
def
reset_autovac
(
db
):
def
reset_autovac
(
db
):
"""
Initializes/resets per-table autovacuum/autoanalyze params.
"""
Initializes/resets per-table autovacuum/autoanalyze params.
...
...
This diff is collapsed.
Click to expand it.
hive/indexer/posts.py
+
2
−
2
View file @
e79bca4b
...
@@ -197,7 +197,7 @@ class Posts:
...
@@ -197,7 +197,7 @@ class Posts:
sql
=
"""
sql
=
"""
SELECT id, author_id, permlink_id, parent_id, community_id, is_valid, is_muted, depth
SELECT id, author_id, permlink_id, parent_id, community_id, is_valid, is_muted, depth
FROM add_hive_post(:author, :permlink, :parent_author, :parent_permlink, :date, :community_support_start_date);
FROM add_hive_post(
(
:author
)::varchar
,
(
:permlink
)::varchar
,
(
:parent_author
)::varchar
,
(
:parent_permlink
)::varchar
,
(
:date
)::timestamp
,
(
:community_support_start_date)
::timestamp)
;
"""
"""
row
=
DB
.
query_row
(
sql
,
author
=
op
[
'
author
'
],
permlink
=
op
[
'
permlink
'
],
parent_author
=
op
[
'
parent_author
'
],
row
=
DB
.
query_row
(
sql
,
author
=
op
[
'
author
'
],
permlink
=
op
[
'
permlink
'
],
parent_author
=
op
[
'
parent_author
'
],
...
@@ -342,7 +342,7 @@ class Posts:
...
@@ -342,7 +342,7 @@ class Posts:
updated_at = :date,
updated_at = :date,
depth = :depth,
depth = :depth,
is_muted = :is_muted,
is_muted = :is_muted,
is_valid = :is_valid
,
is_valid = :is_valid
WHERE id = :id
WHERE id = :id
"""
"""
...
...
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