Class PostgreSQLDialect


  • public class PostgreSQLDialect
    extends SQLDialect
    SQL dialect for PostgreSQL database
    • Method Detail

      • getTablesImpl

        @NotNull
        public @NotNull java.sql.PreparedStatement getTablesImpl()
                                                          throws java.sql.SQLException
        Description copied from class: SQLDialect
        Get all tables from the database
        Specified by:
        getTablesImpl in class SQLDialect
        Returns:
        the PreparedStatement with the set parameters
        Throws:
        java.sql.SQLException - if a database error occurs
      • createTableImpl

        @NotNull
        public @NotNull java.sql.PreparedStatement createTableImpl​(@NotNull
                                                                   @NotNull java.lang.String table)
                                                            throws java.sql.SQLException
        Description copied from class: SQLDialect
        Create a table in the database
        Specified by:
        createTableImpl in class SQLDialect
        Parameters:
        table - the table to create
        Returns:
        the PreparedStatement with the set parameters
        Throws:
        java.sql.SQLException - if a database error occurs
      • createKeyImpl

        @NotNull
        public @NotNull java.sql.PreparedStatement createKeyImpl​(@NotNull
                                                                 @NotNull java.lang.String table,
                                                                 @NotNull
                                                                 @NotNull java.lang.String key)
                                                          throws java.sql.SQLException
        Description copied from class: SQLDialect
        Create a key in the given table
        Specified by:
        createKeyImpl in class SQLDialect
        Parameters:
        table - the table to create the key in
        key - the key to create
        Returns:
        the PreparedStatement with the set parameters
        Throws:
        java.sql.SQLException - if a database error occurs
      • getAllValuesFromDatabaseImpl

        @NotNull
        protected @NotNull java.sql.PreparedStatement getAllValuesFromDatabaseImpl​(@NotNull
                                                                                   @NotNull java.lang.String table)
                                                                            throws java.sql.SQLException
        Description copied from class: SQLDialect
        Get all values from the database
        Specified by:
        getAllValuesFromDatabaseImpl in class SQLDialect
        Parameters:
        table - the table to get the values from
        Returns:
        the PreparedStatement with the set parameters
        Throws:
        java.sql.SQLException - if a database error occurs
      • getFromDatabaseImpl

        @NotNull
        public @NotNull java.util.Optional<java.lang.String> getFromDatabaseImpl​(@NotNull
                                                                                 @NotNull java.lang.String table,
                                                                                 @NotNull
                                                                                 @NotNull java.lang.String target,
                                                                                 @NotNull
                                                                                 @NotNull java.lang.String column)
        Description copied from class: Dialect
        Get a value from the database
        Specified by:
        getFromDatabaseImpl in class Dialect
        Parameters:
        table - the table to get from
        target - the target to get from
        column - the key to get
        Returns:
        the value, empty if not found
      • setToDatabaseImpl

        @Nullable
        public @Nullable FailedSet setToDatabaseImpl​(@NotNull
                                                     @NotNull java.lang.String table,
                                                     @NotNull
                                                     @NotNull java.lang.String target,
                                                     @NotNull
                                                     @NotNull java.lang.String column,
                                                     @NotNull
                                                     @NotNull java.lang.String value)
        Description copied from class: Dialect
        Set a value to the database
        Specified by:
        setToDatabaseImpl in class Dialect
        Parameters:
        table - the table to set to
        target - the target to set to
        column - the key to set
        value - the value to set
        Returns:
        the failed value information, null if successful
      • setToDatabaseImpl

        @NotNull
        public @NotNull java.util.Set<FailedSet> setToDatabaseImpl​(@NotNull
                                                                   @NotNull java.lang.String table,
                                                                   @NotNull
                                                                   @NotNull java.lang.String target,
                                                                   @NotNull
                                                                   @NotNull java.util.concurrent.ConcurrentHashMap<java.lang.String,​Value> data)
        Description copied from class: Dialect
        Set multiple values to the database
        Specified by:
        setToDatabaseImpl in class Dialect
        Parameters:
        table - the table to set to
        target - the target to set to
        data - the data to set
        Returns:
        set of failed values as FailedSets
      • removeFromDatabaseImpl

        public boolean removeFromDatabaseImpl​(@NotNull
                                              @NotNull java.lang.String table,
                                              @NotNull
                                              @NotNull java.lang.String target,
                                              @NotNull
                                              @NotNull java.lang.String column)
        Description copied from class: Dialect
        Remove a value from the database
        Specified by:
        removeFromDatabaseImpl in class Dialect
        Parameters:
        table - the table to remove from
        target - the target to remove from
        column - the key to remove
        Returns:
        true if the value was successfully removed, false otherwise