Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar Mailbox
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
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Briar Mailbox
Merge requests
!20
Remove DatabaseComponent and use Database directly
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Remove DatabaseComponent and use Database directly
63-remove-database-component
into
main
Overview
24
Commits
7
Pipelines
13
Changes
17
Merged
Remove DatabaseComponent and use Database directly
Sebastian
requested to merge
63-remove-database-component
into
main
Sep 29, 2021
Overview
24
Commits
7
Pipelines
13
Changes
17
Closes
#63 (closed)
1
0
Merge request reports
Compare
main
version 11
a7642761
Sep 29, 2021
version 10
dff72e7d
Sep 29, 2021
version 9
2af14d7b
Sep 29, 2021
version 8
81b802b8
Sep 29, 2021
version 7
90d75f28
Sep 29, 2021
version 6
a14e33cc
Sep 29, 2021
version 5
23cf6627
Sep 29, 2021
version 4
f625aaf4
Sep 29, 2021
version 3
4f5edf55
Sep 29, 2021
version 2
369dc706
Sep 29, 2021
version 1
bed41bb9
Sep 29, 2021
main (base)
and
latest version
latest version
9caf115b
7 commits,
Oct 6, 2021
version 11
a7642761
6 commits,
Sep 29, 2021
version 10
dff72e7d
6 commits,
Sep 29, 2021
version 9
2af14d7b
6 commits,
Sep 29, 2021
version 8
81b802b8
5 commits,
Sep 29, 2021
version 7
90d75f28
5 commits,
Sep 29, 2021
version 6
a14e33cc
4 commits,
Sep 29, 2021
version 5
23cf6627
4 commits,
Sep 29, 2021
version 4
f625aaf4
4 commits,
Sep 29, 2021
version 3
4f5edf55
3 commits,
Sep 29, 2021
version 2
369dc706
2 commits,
Sep 29, 2021
version 1
bed41bb9
1 commit,
Sep 29, 2021
17 files
+
399
−
174
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
17
mailbox-core/src/main/java/org/briarproject/mailbox/core/db/Database.kt
+
6
−
26
View file @ 9caf115b
Edit in single-file editor
Open in Web IDE
Show full file
@@ -2,9 +2,8 @@ package org.briarproject.mailbox.core.db
import
org.briarproject.mailbox.core.api.Contact
import
org.briarproject.mailbox.core.settings.Settings
import
java.sql.Connection
interface
Database
<
T
>
{
interface
Database
:
TransactionManager
{
/**
* Opens the database and returns true if the database already existed.
@@ -18,38 +17,19 @@ interface Database<T> {
@Throws
(
DbException
::
class
)
fun
close
()
/**
* Starts a new transaction and returns an object representing it.
*/
@Throws
(
DbException
::
class
)
fun
startTransaction
():
T
/**
* Aborts the given transaction - no changes made during the transaction
* will be applied to the database.
*/
fun
abortTransaction
(
txn
:
T
)
/**
* Commits the given transaction - all changes made during the transaction
* will be applied to the database.
*/
@Throws
(
DbException
::
class
)
fun
commitTransaction
(
txn
:
T
)
@Throws
(
DbException
::
class
)
fun
getSettings
(
txn
:
Conne
ction
,
namespace
:
String
?
):
Settings
fun
getSettings
(
txn
:
Transa
ction
,
namespace
:
String
):
Settings
@Throws
(
DbException
::
class
)
fun
mergeSettings
(
txn
:
Conne
ction
,
s
:
Settings
,
namespace
:
String
?
)
fun
mergeSettings
(
txn
:
Transa
ction
,
s
:
Settings
,
namespace
:
String
)
@Throws
(
DbException
::
class
)
fun
addContact
(
txn
:
T
,
contact
:
Contact
)
fun
addContact
(
txn
:
T
ransaction
,
contact
:
Contact
)
@Throws
(
DbException
::
class
)
fun
getContact
(
txn
:
T
,
id
:
Int
):
Contact
?
fun
getContact
(
txn
:
T
ransaction
,
id
:
Int
):
Contact
?
@Throws
(
DbException
::
class
)
fun
removeContact
(
txn
:
T
,
id
:
Int
)
fun
removeContact
(
txn
:
T
ransaction
,
id
:
Int
)
}
Loading