From cddf0ed143fd79f1186c11d6265865af4638226f Mon Sep 17 00:00:00 2001 From: rocket Date: Mon, 25 Oct 2021 06:02:09 +0300 Subject: [PATCH] (#101) Added puzzles and skeleton for latter implementation --- .../objects/dbms/postgres/PgConstraints.java | 48 +++++++++++++++++++ .../objects/dbms/postgres/PgData.java | 42 ++++++++++++++++ .../objects/dbms/postgres/PgDomains.java | 42 ++++++++++++++++ .../objects/dbms/postgres/PgEnums.java | 48 +++++++++++++++++++ .../objects/dbms/postgres/PgFunctions.java | 48 +++++++++++++++++++ .../objects/dbms/postgres/PgIndexes.java | 48 +++++++++++++++++++ .../objects/dbms/postgres/PgProcedures.java | 48 +++++++++++++++++++ .../objects/dbms/postgres/PgSequences.java | 48 +++++++++++++++++++ .../objects/dbms/postgres/PgTableSpace.java | 42 ++++++++++++++++ .../objects/dbms/postgres/PgTables.java | 42 ++++++++++++++++ .../objects/dbms/postgres/PgTriggers.java | 42 ++++++++++++++++ .../objects/dbms/postgres/PgTuples.java | 42 ++++++++++++++++ .../objects/dbms/postgres/PgViews.java | 42 ++++++++++++++++ 13 files changed, 582 insertions(+) create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgConstraints.java create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgData.java create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgDomains.java create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgEnums.java create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgFunctions.java create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgIndexes.java create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgProcedures.java create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgSequences.java create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTableSpace.java create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTables.java create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTriggers.java create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTuples.java create mode 100644 src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgViews.java diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgConstraints.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgConstraints.java new file mode 100644 index 0000000..c5e4c3f --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgConstraints.java @@ -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>( + PostgresSchemaOfResultSet::new, + () -> connection.createStatement().executeQuery( + "" + ) + ) + ); + } + +} diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgData.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgData.java new file mode 100644 index 0000000..c709f16 --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgData.java @@ -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<>() + ); + } + +} diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgDomains.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgDomains.java new file mode 100644 index 0000000..049d4e9 --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgDomains.java @@ -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<>() + ); + } + +} diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgEnums.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgEnums.java new file mode 100644 index 0000000..790349a --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgEnums.java @@ -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>( + PostgresSchemaOfResultSet::new, + () -> connection.createStatement().executeQuery( + "" + ) + ) + ); + } + +} diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgFunctions.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgFunctions.java new file mode 100644 index 0000000..14b8943 --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgFunctions.java @@ -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>( + PostgresSchemaOfResultSet::new, + () -> connection.createStatement().executeQuery( + "" + ) + ) + ); + } + +} diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgIndexes.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgIndexes.java new file mode 100644 index 0000000..398de03 --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgIndexes.java @@ -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>( + PostgresSchemaOfResultSet::new, + () -> connection.createStatement().executeQuery( + "" + ) + ) + ); + } + +} diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgProcedures.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgProcedures.java new file mode 100644 index 0000000..fcddd63 --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgProcedures.java @@ -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>( + PostgresSchemaOfResultSet::new, + () -> connection.createStatement().executeQuery( + "" + ) + ) + ); + } + +} diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgSequences.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgSequences.java new file mode 100644 index 0000000..23b001a --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgSequences.java @@ -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>( + PostgresSchemaOfResultSet::new, + () -> connection.createStatement().executeQuery( + "" + ) + ) + ); + } + +} diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTableSpace.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTableSpace.java new file mode 100644 index 0000000..22e5ecc --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTableSpace.java @@ -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 tablespaces from DbGit. + * @checkstyle StringLiteralsConcatenationCheck (100 lines) + */ +@SuppressWarnings("PMD") +public class PgTableSpace extends ObjectsOfScalar { + + /** + * Instantiates a new Postgres tablespaces. + * @param connection The Connection to be encapsulated. + */ + public PgTableSpace(final Connection connection) { + super( + () -> new IterableOf<>() + ); + } + +} diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTables.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTables.java new file mode 100644 index 0000000..4bb07d4 --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTables.java @@ -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 Implement fetching tables and columns from DbGit. + * @checkstyle StringLiteralsConcatenationCheck (100 lines) + */ +@SuppressWarnings("PMD") +public class PgTables extends ObjectsOfScalar { + + /** + * Instantiates a new Postgres tables. + * @param connection The Connection to be encapsulated. + */ + public PgTables(final Connection connection) { + super( + () -> new IterableOf<>() + ); + } + +} diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTriggers.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTriggers.java new file mode 100644 index 0000000..a039c3a --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTriggers.java @@ -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 triggers from DbGit. + * @checkstyle StringLiteralsConcatenationCheck (100 lines) + */ +@SuppressWarnings("PMD") +public class PgTriggers extends ObjectsOfScalar { + + /** + * Instantiates a new Postgres triggers. + * @param connection The Connection to be encapsulated. + */ + public PgTriggers(final Connection connection) { + super( + () -> new IterableOf<>() + ); + } + +} diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTuples.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTuples.java new file mode 100644 index 0000000..9ee9f29 --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgTuples.java @@ -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 UDT's (tuples) from DbGit. + * @checkstyle StringLiteralsConcatenationCheck (100 lines) + */ +@SuppressWarnings("PMD") +public class PgTuples extends ObjectsOfScalar { + + /** + * Instantiates a new Postgres tuples (UDT's) . + * @param connection The Connection to be encapsulated. + */ + public PgTuples(final Connection connection) { + super( + () -> new IterableOf<>() + ); + } + +} diff --git a/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgViews.java b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgViews.java new file mode 100644 index 0000000..f698339 --- /dev/null +++ b/src/main/java/org/fusionsoft/database/snapshot/objects/dbms/postgres/PgViews.java @@ -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 views from DbGit. + * @checkstyle StringLiteralsConcatenationCheck (100 lines) + */ +@SuppressWarnings("PMD") +public class PgViews extends ObjectsOfScalar { + + /** + * Instantiates a new Postgres views. + * @param connection The Connection to be encapsulated. + */ + public PgViews(final Connection connection) { + super( + () -> new IterableOf<>() + ); + } + +}