Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bwinf
medal
Commits
fa4006ee
Commit
fa4006ee
authored
Oct 30, 2019
by
Robert Czechowski
Browse files
Order contests by ID
parent
e424e41c
Pipeline
#273
passed with stages
in 13 minutes and 24 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/db_conn_postgres.rs
View file @
fa4006ee
...
...
@@ -535,7 +535,7 @@ impl MedalConnection for Connection {
fn
get_contest_list
(
&
self
)
->
Vec
<
Contest
>
{
let
res
=
self
.query
(
"SELECT id, location, filename, name, duration, public, start_date, end_date FROM contest"
,
&
[])
self
.query
(
"SELECT id, location, filename, name, duration, public, start_date, end_date FROM contest
ORDER BY id
"
,
&
[])
.unwrap
();
res
.iter
()
.map
(|
row
|
Contest
{
id
:
Some
(
row
.get
(
0
)),
...
...
src/db_conn_sqlite.rs
View file @
fa4006ee
...
...
@@ -527,7 +527,7 @@ impl MedalConnection for Connection {
fn
get_contest_list
(
&
self
)
->
Vec
<
Contest
>
{
let
mut
stmt
=
self
.prepare
(
"SELECT id, location, filename, name, duration, public, start_date, end_date FROM contest"
)
self
.prepare
(
"SELECT id, location, filename, name, duration, public, start_date, end_date FROM contest
ORDER BY id
"
)
.unwrap
();
let
res
=
stmt
.query_map
(
&
[],
|
row
|
Contest
{
id
:
Some
(
row
.get
(
0
)),
location
:
row
.get
(
1
),
...
...
Write
Preview
Markdown
is supported
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