-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
429 additions
and
112 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
49 changes: 49 additions & 0 deletions
49
sadu-core/src/main/java/de/chojo/sadu/core/configuration/DatabaseConfig.java
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,49 @@ | ||
/* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
|
||
package de.chojo.sadu.core.configuration; | ||
|
||
/** | ||
* This interface represents the configuration for a database connection. | ||
* It provides methods to retrieve the address, port, user, password, and database name. | ||
*/ | ||
public interface DatabaseConfig { | ||
/** | ||
* Returns the address of the database server. | ||
* | ||
* @return the address of the database server | ||
*/ | ||
String host(); | ||
|
||
/** | ||
* Returns the port for the database connection. | ||
* | ||
* @return the port for the database connection | ||
*/ | ||
String port(); | ||
|
||
/** | ||
* Retrieves the username associated with the database connection. | ||
* | ||
* @return The username as a string. | ||
*/ | ||
String user(); | ||
|
||
/** | ||
* Returns the password for the database user. | ||
* | ||
* @return the password for the database user | ||
*/ | ||
String password(); | ||
|
||
/** | ||
* Returns the database for the database connection. | ||
* | ||
* @return The name of the database. | ||
*/ | ||
String database(); | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
sadu-core/src/main/java/de/chojo/sadu/core/configuration/SchemaProvider.java
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 @@ | ||
/* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
|
||
package de.chojo.sadu.core.configuration; | ||
|
||
public interface SchemaProvider { | ||
String schema(); | ||
} |
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
54 changes: 0 additions & 54 deletions
54
sadu-datasource/src/main/java/de/chojo/sadu/datasource/DatabaseConfig.java
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
...datasource/src/main/java/de/chojo/sadu/datasource/configuration/SchemaDatabaseConfig.java
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,18 @@ | ||
/* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
|
||
package de.chojo.sadu.datasource.configuration; | ||
|
||
import de.chojo.sadu.core.configuration.DatabaseConfig; | ||
import de.chojo.sadu.core.configuration.SchemaProvider; | ||
|
||
/** | ||
* Record which provides basic data for a database connection with a schema | ||
*/ | ||
|
||
public record SchemaDatabaseConfig(String host, String port, String user, String password, String database, | ||
String schema) implements DatabaseConfig, SchemaProvider { | ||
} |
14 changes: 14 additions & 0 deletions
14
...datasource/src/main/java/de/chojo/sadu/datasource/configuration/SimpleDatabaseConfig.java
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,14 @@ | ||
/* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
|
||
package de.chojo.sadu.datasource.configuration; | ||
|
||
/** | ||
* Record which provides basic data for a database connection | ||
*/ | ||
public record SimpleDatabaseConfig(String host, String port, String user, String password, | ||
String database) implements de.chojo.sadu.core.configuration.DatabaseConfig { | ||
} |
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
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
27 changes: 27 additions & 0 deletions
27
...c/main/java/de/chojo/sadu/queries/api/results/writing/insertion/InsertionBatchResult.java
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,27 @@ | ||
/* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
|
||
package de.chojo.sadu.queries.api.results.writing.insertion; | ||
|
||
import de.chojo.sadu.queries.api.results.writing.manipulation.ManipulationBatchResult; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* The InsertionBatchResult interface represents the result of a batch insertion operation. | ||
* It extends the ManipulationBatchResult interface and adds the ability to retrieve the keys of the inserted rows. | ||
* | ||
* @param <T> the type of InsertionResult | ||
*/ | ||
public interface InsertionBatchResult<T extends InsertionResult> extends ManipulationBatchResult<T>, InsertionResult { | ||
/** | ||
* Retrieves the keys of the inserted rows of all executed statements. | ||
* | ||
* @return a List of Long representing the keys of the inserted rows | ||
*/ | ||
@Override | ||
List<Long> keys(); | ||
} |
25 changes: 25 additions & 0 deletions
25
...es/src/main/java/de/chojo/sadu/queries/api/results/writing/insertion/InsertionResult.java
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,25 @@ | ||
/* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
|
||
package de.chojo.sadu.queries.api.results.writing.insertion; | ||
|
||
import de.chojo.sadu.queries.api.results.writing.manipulation.ManipulationResult; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* The InsertionResult interface represents the result of an insertion operation. | ||
* It extends the ManipulationResult interface and adds the ability to retrieve the keys of the inserted rows. | ||
*/ | ||
public interface InsertionResult extends ManipulationResult { | ||
/** | ||
* Retrieves the keys of the inserted rows. | ||
* | ||
* @return a List of Long representing the keys of the inserted rows | ||
*/ | ||
List<Long> keys(); | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...eries/src/main/java/de/chojo/sadu/queries/api/results/writing/insertion/package-info.java
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,4 @@ | ||
/** | ||
* Defines the result of an insertion action. | ||
*/ | ||
package de.chojo.sadu.queries.api.results.writing.insertion; |
Oops, something went wrong.