-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement published entity configuration statement persistence
- Loading branch information
Showing
14 changed files
with
145 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
modules/persistence/src/commonMain/kotlin/com/sphereon/oid/fed/persistence/Persistence.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package com.sphereon.oid.fed.persistence | ||
|
||
import com.sphereon.oid.fed.persistence.repositories.AccountRepository | ||
import com.sphereon.oid.fed.persistence.repositories.KeyRepository | ||
import com.sphereon.oid.fed.persistence.repositories.SubordinateRepository | ||
import com.sphereon.oid.fed.persistence.models.AccountQueries | ||
import com.sphereon.oid.fed.persistence.models.EntityConfigurationStatementQueries | ||
import com.sphereon.oid.fed.persistence.models.KeyQueries | ||
import com.sphereon.oid.fed.persistence.models.SubordinateQueries | ||
|
||
expect object Persistence { | ||
val accountRepository: AccountRepository | ||
val keyRepository: KeyRepository | ||
val subordinateRepository: SubordinateRepository | ||
val entityConfigurationStatementQueries: EntityConfigurationStatementQueries | ||
val accountQueries: AccountQueries | ||
val keyQueries: KeyQueries | ||
val subordinateQueries: SubordinateQueries | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE entityConfigurationStatement ( | ||
id SERIAL PRIMARY KEY, | ||
account_id INT NOT NULL, | ||
statement TEXT NOT NULL, | ||
expires_at BIGINT NOT NULL, | ||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | ||
CONSTRAINT FK_ParentEntityStatement FOREIGN KEY (account_id) REFERENCES account (id), | ||
UNIQUE (account_id) | ||
); | ||
|
||
CREATE INDEX entity_statement_account_id_index ON subordinate (account_id); |
30 changes: 15 additions & 15 deletions
30
...onMain/sqldelight/com/sphereon/oid/fed/persistence/models/EntityConfigurationStatement.sq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
findByAccountId: | ||
SELECT * FROM entityStatement WHERE account_id = ?; | ||
findById: | ||
SELECT * FROM entityStatement WHERE id = ?; | ||
create: | ||
INSERT INTO entityStatement ( | ||
account_id, | ||
statement, | ||
expires_at | ||
) VALUES (?, ?, ?) RETURNING *; | ||
findLatestByAccountId: | ||
SELECT * FROM entityStatement WHERE account_id = ? ORDER BY created_at DESC LIMIT 1; | ||
findByAccountId: | ||
SELECT * FROM entityConfigurationStatement WHERE account_id = ?; | ||
|
||
findById: | ||
SELECT * FROM entityConfigurationStatement WHERE id = ?; | ||
|
||
create: | ||
INSERT INTO entityConfigurationStatement ( | ||
account_id, | ||
statement, | ||
expires_at | ||
) VALUES (?, ?, ?) RETURNING *; | ||
|
||
findLatestByAccountId: | ||
SELECT * FROM entityConfigurationStatement WHERE account_id = ? ORDER BY created_at DESC LIMIT 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.