-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#101) Added puzzles and skeleton for latter implementation
- Loading branch information
Showing
13 changed files
with
582 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgConstraints.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,48 @@ | ||
/* | ||
* Copyright (C) 2018-2021 FusionSoft | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. | ||
* | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
package org.fusionsoft.database.snapshot.objects.dbms.postgres; | ||
|
||
import java.sql.Connection; | ||
import org.fusionsoft.database.snapshot.DbObject; | ||
import org.fusionsoft.database.snapshot.Objects; | ||
import org.fusionsoft.database.snapshot.objects.ObjectsOfScalar; | ||
import org.fusionsoft.lib.collection.ListOfResultSet; | ||
|
||
/** | ||
* The type of {@link Objects} that can be constructed of connection to Postgres DBMS. | ||
* @since 0.1 | ||
* @todo #101:30min Adapt query for constraints from DbGit. | ||
* @checkstyle StringLiteralsConcatenationCheck (100 lines) | ||
*/ | ||
public class PgConstraints extends ObjectsOfScalar { | ||
|
||
/** | ||
* Instantiates a new Postgres constraints. | ||
* @param connection The Connection to be encapsulated. | ||
*/ | ||
public PgConstraints(final Connection connection) { | ||
super( | ||
() -> | ||
new ListOfResultSet<DbObject<?>>( | ||
PostgresSchemaOfResultSet::new, | ||
() -> connection.createStatement().executeQuery( | ||
"" | ||
) | ||
) | ||
); | ||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgData.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,42 @@ | ||
/* | ||
* Copyright (C) 2018-2021 FusionSoft | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. | ||
* | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
package org.fusionsoft.database.snapshot.objects.dbms.postgres; | ||
|
||
import java.sql.Connection; | ||
import org.cactoos.iterable.IterableOf; | ||
import org.fusionsoft.database.snapshot.Objects; | ||
import org.fusionsoft.database.snapshot.objects.ObjectsOfScalar; | ||
|
||
/** | ||
* The type of {@link Objects} that can be constructed of connection to Postgres DBMS. | ||
* @since 0.1 | ||
* @todo #101:30min Consider solutions hierarchy for fetching data. | ||
* @checkstyle StringLiteralsConcatenationCheck (100 lines) | ||
*/ | ||
@SuppressWarnings("PMD") | ||
public class PgData extends ObjectsOfScalar { | ||
|
||
/** | ||
* Instantiates a new Postgres ... . | ||
* @param connection The Connection to be encapsulated. | ||
*/ | ||
public PgData(final Connection connection) { | ||
super( | ||
() -> new IterableOf<>() | ||
); | ||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgDomains.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,42 @@ | ||
/* | ||
* Copyright (C) 2018-2021 FusionSoft | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. | ||
* | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
package org.fusionsoft.database.snapshot.objects.dbms.postgres; | ||
|
||
import java.sql.Connection; | ||
import org.cactoos.iterable.IterableOf; | ||
import org.fusionsoft.database.snapshot.Objects; | ||
import org.fusionsoft.database.snapshot.objects.ObjectsOfScalar; | ||
|
||
/** | ||
* The type of {@link Objects} that can be constructed of connection to Postgres DBMS. | ||
* @since 0.1 | ||
* @todo #101:30min Adapt query for domains from DbGit. | ||
* @checkstyle StringLiteralsConcatenationCheck (100 lines) | ||
*/ | ||
@SuppressWarnings("PMD") | ||
public class PgDomains extends ObjectsOfScalar { | ||
|
||
/** | ||
* Instantiates a new Postgres domains (UDT's). | ||
* @param connection The Connection to be encapsulated. | ||
*/ | ||
public PgDomains(final Connection connection) { | ||
super( | ||
() -> new IterableOf<>() | ||
); | ||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgEnums.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,48 @@ | ||
/* | ||
* Copyright (C) 2018-2021 FusionSoft | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. | ||
* | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
package org.fusionsoft.database.snapshot.objects.dbms.postgres; | ||
|
||
import java.sql.Connection; | ||
import org.fusionsoft.database.snapshot.DbObject; | ||
import org.fusionsoft.database.snapshot.Objects; | ||
import org.fusionsoft.database.snapshot.objects.ObjectsOfScalar; | ||
import org.fusionsoft.lib.collection.ListOfResultSet; | ||
|
||
/** | ||
* The type of {@link Objects} that can be constructed of connection to Postgres DBMS. | ||
* @since 0.1 | ||
* @todo #101:30min Adapt query for enums from DbGit. | ||
* @checkstyle StringLiteralsConcatenationCheck (100 lines) | ||
*/ | ||
public class PgEnums extends ObjectsOfScalar { | ||
|
||
/** | ||
* Instantiates a new Postgres enums (UDT's). | ||
* @param connection The Connection to be encapsulated. | ||
*/ | ||
public PgEnums(final Connection connection) { | ||
super( | ||
() -> | ||
new ListOfResultSet<DbObject<?>>( | ||
PostgresSchemaOfResultSet::new, | ||
() -> connection.createStatement().executeQuery( | ||
"" | ||
) | ||
) | ||
); | ||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgFunctions.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,48 @@ | ||
/* | ||
* Copyright (C) 2018-2021 FusionSoft | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. | ||
* | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
package org.fusionsoft.database.snapshot.objects.dbms.postgres; | ||
|
||
import java.sql.Connection; | ||
import org.fusionsoft.database.snapshot.DbObject; | ||
import org.fusionsoft.database.snapshot.Objects; | ||
import org.fusionsoft.database.snapshot.objects.ObjectsOfScalar; | ||
import org.fusionsoft.lib.collection.ListOfResultSet; | ||
|
||
/** | ||
* The type of {@link Objects} that can be constructed of connection to Postgres DBMS. | ||
* @since 0.1 | ||
* @todo #101:30min Adapt query for functions from DbGit. | ||
* @checkstyle StringLiteralsConcatenationCheck (100 lines) | ||
*/ | ||
public class PgFunctions extends ObjectsOfScalar { | ||
|
||
/** | ||
* Instantiates a new Postgres ... . | ||
* @param connection The Connection to be encapsulated. | ||
*/ | ||
public PgFunctions(final Connection connection) { | ||
super( | ||
() -> | ||
new ListOfResultSet<DbObject<?>>( | ||
PostgresSchemaOfResultSet::new, | ||
() -> connection.createStatement().executeQuery( | ||
"" | ||
) | ||
) | ||
); | ||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgIndexes.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,48 @@ | ||
/* | ||
* Copyright (C) 2018-2021 FusionSoft | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. | ||
* | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
package org.fusionsoft.database.snapshot.objects.dbms.postgres; | ||
|
||
import java.sql.Connection; | ||
import org.fusionsoft.database.snapshot.DbObject; | ||
import org.fusionsoft.database.snapshot.Objects; | ||
import org.fusionsoft.database.snapshot.objects.ObjectsOfScalar; | ||
import org.fusionsoft.lib.collection.ListOfResultSet; | ||
|
||
/** | ||
* The type of {@link Objects} that can be constructed of connection to Postgres DBMS. | ||
* @since 0.1 | ||
* @todo #101:30min Adapt query for indexes from DbGit. | ||
* @checkstyle StringLiteralsConcatenationCheck (100 lines) | ||
*/ | ||
public class PgIndexes extends ObjectsOfScalar { | ||
|
||
/** | ||
* Instantiates a new Postgres ... . | ||
* @param connection The Connection to be encapsulated. | ||
*/ | ||
public PgIndexes(final Connection connection) { | ||
super( | ||
() -> | ||
new ListOfResultSet<DbObject<?>>( | ||
PostgresSchemaOfResultSet::new, | ||
() -> connection.createStatement().executeQuery( | ||
"" | ||
) | ||
) | ||
); | ||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgProcedures.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,48 @@ | ||
/* | ||
* Copyright (C) 2018-2021 FusionSoft | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. | ||
* | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
package org.fusionsoft.database.snapshot.objects.dbms.postgres; | ||
|
||
import java.sql.Connection; | ||
import org.fusionsoft.database.snapshot.DbObject; | ||
import org.fusionsoft.database.snapshot.Objects; | ||
import org.fusionsoft.database.snapshot.objects.ObjectsOfScalar; | ||
import org.fusionsoft.lib.collection.ListOfResultSet; | ||
|
||
/** | ||
* The type of {@link Objects} that can be constructed of connection to Postgres DBMS. | ||
* @since 0.1 | ||
* @todo #101:30min Adapt query for procedures from DbGit. | ||
* @checkstyle StringLiteralsConcatenationCheck (100 lines) | ||
*/ | ||
public class PgProcedures extends ObjectsOfScalar { | ||
|
||
/** | ||
* Instantiates a new Postgres ... . | ||
* @param connection The Connection to be encapsulated. | ||
*/ | ||
public PgProcedures(final Connection connection) { | ||
super( | ||
() -> | ||
new ListOfResultSet<DbObject<?>>( | ||
PostgresSchemaOfResultSet::new, | ||
() -> connection.createStatement().executeQuery( | ||
"" | ||
) | ||
) | ||
); | ||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgSequences.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,48 @@ | ||
/* | ||
* Copyright (C) 2018-2021 FusionSoft | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. | ||
* | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
package org.fusionsoft.database.snapshot.objects.dbms.postgres; | ||
|
||
import java.sql.Connection; | ||
import org.fusionsoft.database.snapshot.DbObject; | ||
import org.fusionsoft.database.snapshot.Objects; | ||
import org.fusionsoft.database.snapshot.objects.ObjectsOfScalar; | ||
import org.fusionsoft.lib.collection.ListOfResultSet; | ||
|
||
/** | ||
* The type of {@link Objects} that can be constructed of connection to Postgres DBMS. | ||
* @since 0.1 | ||
* @todo #101:30min Adapt query for sequences from DbGit. | ||
* @checkstyle StringLiteralsConcatenationCheck (100 lines) | ||
*/ | ||
public class PgSequences extends ObjectsOfScalar { | ||
|
||
/** | ||
* Instantiates a new Postgres ... . | ||
* @param connection The Connection to be encapsulated. | ||
*/ | ||
public PgSequences(final Connection connection) { | ||
super( | ||
() -> | ||
new ListOfResultSet<DbObject<?>>( | ||
PostgresSchemaOfResultSet::new, | ||
() -> connection.createStatement().executeQuery( | ||
"" | ||
) | ||
) | ||
); | ||
} | ||
|
||
} |
Oops, something went wrong.