Class FRL

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    @API(EXPERIMENTAL)
    public class FRL
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Temporary class. "The Relational Database". Facade over RelationalDatabase. Mostly copied from cli DbState but cut-down. TODO: Remove having to go via embedded JDBC.... It is unnecessary overhead. TODO: What can be shared in here? I want to do concurrent query handling. What is unsafe? TODO: How does RelationalDatabase relate? TODO: Let this be front door to the relational DB used by Server? Hide the driver and connection stuff behind here?
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  FRL.Response  
    • Constructor Summary

      Constructors 
      Constructor Description
      FRL()  
      FRL​(com.apple.foundationdb.relational.api.Options options)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      FRL.Response execute​(java.lang.String database, java.lang.String schema, java.lang.String sql, java.util.List<com.apple.foundationdb.relational.jdbc.grpc.v1.Parameter> parameters, com.apple.foundationdb.relational.api.Options options)
      Execute sql.
      com.apple.foundationdb.relational.api.RelationalResultSet get​(java.lang.String database, java.lang.String schema, java.lang.String tableName, com.apple.foundationdb.relational.api.KeySet keySet)  
      int insert​(java.lang.String database, java.lang.String schema, java.lang.String tableName, java.util.List<com.apple.foundationdb.relational.api.RelationalStruct> data)  
      com.apple.foundationdb.relational.api.RelationalResultSet scan​(java.lang.String database, java.lang.String schema, java.lang.String tableName, com.apple.foundationdb.relational.api.KeySet keySet)  
      int update​(java.lang.String database, java.lang.String schema, java.lang.String sql)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FRL

        public FRL()
            throws com.apple.foundationdb.relational.api.exceptions.RelationalException
        Throws:
        com.apple.foundationdb.relational.api.exceptions.RelationalException
      • FRL

        public FRL​(@Nonnull
                   com.apple.foundationdb.relational.api.Options options)
            throws com.apple.foundationdb.relational.api.exceptions.RelationalException
        Throws:
        com.apple.foundationdb.relational.api.exceptions.RelationalException
    • Method Detail

      • execute

        @Nonnull
        public FRL.Response execute​(java.lang.String database,
                                    java.lang.String schema,
                                    java.lang.String sql,
                                    java.util.List<com.apple.foundationdb.relational.jdbc.grpc.v1.Parameter> parameters,
                                    com.apple.foundationdb.relational.api.Options options)
                             throws java.sql.SQLException
        Execute sql.
        Parameters:
        database - Database to run the sql against.
        schema - Schema to use on database
        sql - SQL to execute.
        parameters - If non-null, then these are parameters and 'sql' is text of a prepared statement.
        Returns:
        Returns A Response with either a ResultSet or a Row count, depending on the type of query issued
        Throws:
        java.sql.SQLException - For all sorts of reasons.
      • update

        public int update​(java.lang.String database,
                          java.lang.String schema,
                          java.lang.String sql)
                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • insert

        public int insert​(java.lang.String database,
                          java.lang.String schema,
                          java.lang.String tableName,
                          java.util.List<com.apple.foundationdb.relational.api.RelationalStruct> data)
                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • get

        public com.apple.foundationdb.relational.api.RelationalResultSet get​(java.lang.String database,
                                                                             java.lang.String schema,
                                                                             java.lang.String tableName,
                                                                             com.apple.foundationdb.relational.api.KeySet keySet)
                                                                      throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • scan

        public com.apple.foundationdb.relational.api.RelationalResultSet scan​(java.lang.String database,
                                                                              java.lang.String schema,
                                                                              java.lang.String tableName,
                                                                              com.apple.foundationdb.relational.api.KeySet keySet)
                                                                       throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • close

        public void close()
                   throws java.sql.SQLException,
                          com.apple.foundationdb.relational.api.exceptions.RelationalException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.sql.SQLException
        com.apple.foundationdb.relational.api.exceptions.RelationalException