Class QueryExecutor

java.lang.Object
com.github.darksoulq.abyssallib.common.database.relational.postgres.QueryExecutor

public class QueryExecutor extends Object
A PostgreSQL-aware query dispatcher.

This class acts as a factory for table queries and builders, ensuring that all operations are performed using the latest valid connection from the associated Database.

  • Constructor Details

    • QueryExecutor

      public QueryExecutor(Database database)
      Constructs a new QueryExecutor.
      Parameters:
      database - The parent Database instance.
  • Method Details

    • table

      public TableQuery table(String name)
      Starts a fluent query builder for a specific table.
      Parameters:
      name - The table name.
      Returns:
      A new TableQuery instance.
    • create

      public TableBuilder create(String name)
      Starts a fluent table schema builder.
      Parameters:
      name - The name of the table to create.
      Returns:
      A new TableBuilder instance.
    • executeRaw

      public void executeRaw(String sql) throws Exception
      Executes a raw SQL string. This is typically used for administrative tasks or non-standard queries.
      Parameters:
      sql - The raw SQL to execute.
      Throws:
      Exception - If a database access error occurs.