-
Notifications
You must be signed in to change notification settings - Fork 82
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
Tobias Hafner
committed
May 2, 2024
1 parent
f986ca6
commit d1292e8
Showing
10 changed files
with
210 additions
and
147 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
38 changes: 38 additions & 0 deletions
38
core/src/main/java/org/polypheny/db/adapter/DocumentDataSource.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,38 @@ | ||
/* | ||
* Copyright 2019-2024 The Polypheny Project | ||
* | ||
* 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.polypheny.db.adapter; | ||
|
||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.polypheny.db.catalog.logistic.EntityType; | ||
|
||
public interface DocumentDataSource { | ||
|
||
List<ExportedDocument> getExportedCollection(); | ||
|
||
@AllArgsConstructor | ||
@Getter | ||
class ExportedDocument { | ||
|
||
private final String name; | ||
private final boolean isModifyable; | ||
private final EntityType type; | ||
|
||
} | ||
|
||
} |
67 changes: 67 additions & 0 deletions
67
core/src/main/java/org/polypheny/db/adapter/RelationalDataSource.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,67 @@ | ||
/* | ||
* Copyright 2019-2024 The Polypheny Project | ||
* | ||
* 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.polypheny.db.adapter; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import lombok.AllArgsConstructor; | ||
import org.polypheny.db.type.PolyType; | ||
|
||
public interface RelationalDataSource { | ||
|
||
Map<String, List<ExportedColumn>> getExportedColumns(); | ||
|
||
@AllArgsConstructor | ||
class ExportedColumn { | ||
|
||
public final String name; | ||
public final PolyType type; | ||
public final PolyType collectionsType; | ||
public final Integer length; | ||
public final Integer scale; | ||
public final Integer dimension; | ||
public final Integer cardinality; | ||
public final boolean nullable; | ||
public final String physicalSchemaName; | ||
public final String physicalTableName; | ||
public final String physicalColumnName; | ||
public final int physicalPosition; | ||
public final boolean primary; | ||
|
||
|
||
public String getDisplayType() { | ||
String typeStr = type.getName(); | ||
if ( scale != null ) { | ||
typeStr += "(" + length + "," + scale + ")"; | ||
} else if ( length != null ) { | ||
typeStr += "(" + length + ")"; | ||
} | ||
|
||
if ( collectionsType != null ) { | ||
typeStr += " " + collectionsType.getName(); | ||
if ( cardinality != null ) { | ||
typeStr += "(" + dimension + "," + cardinality + ")"; | ||
} else if ( dimension != null ) { | ||
typeStr += "(" + dimension + ")"; | ||
} | ||
} | ||
return typeStr; | ||
} | ||
|
||
} | ||
|
||
} |
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.