Package io.trino.plugin.mongodb
Class MongoSession
- java.lang.Object
-
- io.trino.plugin.mongodb.MongoSession
-
public class MongoSession extends Object
-
-
Constructor Summary
Constructors Constructor Description MongoSession(TypeManager typeManager, com.mongodb.MongoClient client, MongoClientConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumn(SchemaTableName schemaTableName, ColumnMetadata columnMetadata)booleancollectionExists(com.mongodb.client.MongoDatabase db, String collectionName)voidcreateTable(SchemaTableName name, List<MongoColumnHandle> columns)voiddropColumn(SchemaTableName schemaTableName, String columnName)voiddropTable(SchemaTableName tableName)com.mongodb.client.MongoCursor<org.bson.Document>execute(MongoTableHandle tableHandle, List<MongoColumnHandle> columns)List<String>getAllSchemas()Set<String>getAllTables(String schema)com.mongodb.client.MongoCollection<org.bson.Document>getCollection(SchemaTableName tableName)List<MongoIndex>getIndexes(String schemaName, String tableName)MongoTablegetTable(SchemaTableName tableName)voidshutdown()
-
-
-
Constructor Detail
-
MongoSession
public MongoSession(TypeManager typeManager, com.mongodb.MongoClient client, MongoClientConfig config)
-
-
Method Detail
-
shutdown
public void shutdown()
-
getAllTables
public Set<String> getAllTables(String schema) throws SchemaNotFoundException
- Throws:
SchemaNotFoundException
-
getTable
public MongoTable getTable(SchemaTableName tableName) throws TableNotFoundException
- Throws:
TableNotFoundException
-
createTable
public void createTable(SchemaTableName name, List<MongoColumnHandle> columns)
-
dropTable
public void dropTable(SchemaTableName tableName)
-
addColumn
public void addColumn(SchemaTableName schemaTableName, ColumnMetadata columnMetadata)
-
dropColumn
public void dropColumn(SchemaTableName schemaTableName, String columnName)
-
getCollection
public com.mongodb.client.MongoCollection<org.bson.Document> getCollection(SchemaTableName tableName)
-
getIndexes
public List<MongoIndex> getIndexes(String schemaName, String tableName)
-
execute
public com.mongodb.client.MongoCursor<org.bson.Document> execute(MongoTableHandle tableHandle, List<MongoColumnHandle> columns)
-
collectionExists
public boolean collectionExists(com.mongodb.client.MongoDatabase db, String collectionName)
-
-