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
82e3dcca
Commit
82e3dcca
authored
Oct 25, 2019
by
Robert Czechowski
Browse files
Add slight modificated sqlite db connector that is more similar to the postgres db connector
parent
1ea5514a
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Cargo.toml
View file @
82e3dcca
...
...
@@ -11,10 +11,12 @@ license = "LGPL-3.0"
#maintenance = { status = "active-developed" }
[features]
default
=
["rusqlite"]
complete
=
[
"rusqlite"
,
"postgres"
,
"webbrowser"
]
server
=
[
"rusqlite"
,
"postgres"
]
desktop
=
[
"rusqlite"
,
"webbrowser"
]
rusqlite_old
=
["rusqlite"]
rusqlite_new
=
["rusqlite"]
default
=
["rusqlite_old"]
complete
=
[
"rusqlite_old"
,
"postgres"
,
"webbrowser"
]
server
=
[
"rusqlite_old"
,
"postgres"
]
desktop
=
[
"rusqlite_old"
,
"webbrowser"
]
watch
=
["handlebars-iron/watch"]
strict
=
[]
# Treat warnings as a build error
debug
=
[]
...
...
migrations/sqlite_v2/0001_create_contest.sql
0 → 100644
View file @
82e3dcca
CREATE
TABLE
contest
(
id
INTEGER
PRIMARY
KEY
,
location
TEXT
NOT
NULL
,
filename
TEXT
NOT
NULL
,
name
TEXT
NOT
NULL
,
duration
INTEGER
NOT
NULL
,
public
INTEGER
NOT
NULL
,
start_date
TEXT
,
end_date
TEXT
)
migrations/sqlite_v2/0001_create_grade.sql
0 → 100644
View file @
82e3dcca
CREATE
TABLE
grade
(
taskgroup
INTEGER
,
session
INTEGER
,
grade
INTEGER
,
validated
INTEGER
,
PRIMARY
KEY
(
taskgroup
,
session
)
)
migrations/sqlite_v2/0001_create_group.sql
0 → 100644
View file @
82e3dcca
CREATE
TABLE
usergroup
(
id
INTEGER
PRIMARY
KEY
,
name
TEXT
,
groupcode
TEXT
,
tag
TEXT
,
admin
INTEGER
)
migrations/sqlite_v2/0001_create_participation.sql
0 → 100644
View file @
82e3dcca
CREATE
TABLE
participation
(
contest
INTEGER
,
session
INTEGER
,
start_date
TEXT
,
PRIMARY
KEY
(
contest
,
session
)
)
migrations/sqlite_v2/0001_create_session_user.sql
0 → 100644
View file @
82e3dcca
CREATE
TABLE
session
(
id
INTEGER
PRIMARY
KEY
,
session_token
TEXT
,
csrf_token
TEXT
,
last_login
TEXT
,
last_activity
TEXT
,
permanent_login
INTEGER
,
username
TEXT
,
password
TEXT
,
salt
TEXT
,
logincode
TEXT
,
email
TEXT
,
email_unconfirmed
TEXT
,
email_confirmationcode
TEXT
,
firstname
TEXT
,
lastname
TEXT
,
street
TEXT
,
zip
TEXT
,
city
TEXT
,
nation
TEXT
,
grade
INTEGER
,
is_teacher
INTEGER
,
managed_by
INTEGER
,
oauth_foreign_id
TEXT
,
oauth_provider
TEXT
)
migrations/sqlite_v2/0001_create_submission.sql
0 → 100644
View file @
82e3dcca
CREATE
TABLE
submission
(
id
INTEGER
PRIMARY
KEY
,
session
INTEGER
NOT
NULL
,
task
INTEGER
NOT
NULL
,
grade
INTEGER
NOT
NULL
,
validated
INTEGER
NOT
NULL
,
needs_validation
INTEGER
NOT
NULL
,
nonvalidated_grade
INTEGER
NOT
NULL
,
subtask_identifier
TEXT
,
value
TEXT
,
date
TEXT
)
migrations/sqlite_v2/0001_create_task.sql
0 → 100644
View file @
82e3dcca
CREATE
TABLE
task
(
id
INTEGER
PRIMARY
KEY
,
taskgroup
INTEGER
,
location
TEXT
,
stars
INTEGER
)
migrations/sqlite_v2/0001_create_taskgroup.sql
0 → 100644
View file @
82e3dcca
CREATE
TABLE
taskgroup
(
id
INTEGER
PRIMARY
KEY
,
contest
INTEGER
NOT
NULL
,
name
TEXT
NOT
NULL
)
src/db_conn_sqlite.rs
View file @
82e3dcca
#![cfg(feature
=
"rusqlite"
)]
#![cfg(feature
=
"rusqlite
_old
"
)]
extern
crate
rusqlite
;
...
...
src/db_conn_sqlite_new.rs
0 → 100644
View file @
82e3dcca
This diff is collapsed.
Click to expand it.
src/main.rs
View file @
82e3dcca
...
...
@@ -23,7 +23,9 @@ extern crate urlencoded;
#[cfg(feature
=
"postgres"
)]
extern
crate
postgres
;
#[cfg(feature
=
"rusqlite"
)]
#[cfg(feature
=
"rusqlite_old"
)]
extern
crate
rusqlite
;
#[cfg(feature
=
"rusqlite_new"
)]
extern
crate
rusqlite
;
#[cfg(feature
=
"webbrowser"
)]
extern
crate
webbrowser
;
...
...
@@ -38,6 +40,7 @@ pub mod oauth_provider;
mod
db_apply_migrations
;
mod
db_conn_postgres
;
mod
db_conn_sqlite
;
mod
db_conn_sqlite_new
;
mod
db_objects
;
mod
webfw_iron
;
...
...
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