// Path: src/main/java/com/github/susom/database/DatabaseProvider.java
// public static class Pool {
//   public DataSource dataSource;
//   public int size;
//   public Flavor flavor;
//   public Closeable poolShutdown;
// 
//   public Pool(DataSource dataSource, int size, Flavor flavor, Closeable poolShutdown) {
//     this.dataSource = dataSource;
//     this.size = size;
//     this.flavor = flavor;
//     this.poolShutdown = poolShutdown;
//   }
// }


import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.WorkerExecutor;
import java.io.Closeable;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Supplier;
import javax.annotation.CheckReturnValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.susom.database.DatabaseProvider.Pool;
   *                          url; prompted on standard input if user is provided and
   *                          password is not)
   *   database.pool.size=... How many connections in the connection pool (default 10).
   *   database.driver.class  The driver to initialize with Class.forName(). This will
   *                          be guessed from the database.url if not provided.
   *   database.flavor        One of the enumerated values in {@link Flavor}. If this
   *                          is not provided the flavor will be guessed based on the
   *                          value for database.url, if possible.
   * </pre>
   *
   * <p>The database flavor will be guessed based on the URL.</p>
   *
   * <p>A database pool will be created using HikariCP.</p>
   *
   * <p>Be sure to retain a copy of the builder so you can call close() later to
   * destroy the pool. You will most likely want to register a JVM shutdown hook
   * to make sure this happens. See VertxServer.java in the demo directory for
   * an example of how to do this.</p>
   */
  @CheckReturnValue
  public static Builder pooledBuilder(Vertx vertx, Config config) {
    return fromPool(vertx, DatabaseProvider.createPool(config));
  }

  /**
   * Use an externally configured DataSource, Flavor, and optionally a shutdown hook.
   * The shutdown hook may be null if you don't want calls to Builder.close() to attempt
   * any shutdown. The DataSource and Flavor are mandatory.
   */
  @CheckReturnValue
// Path: src/main/java/com/github/susom/database/DatabaseProvider.java
// public static class Pool {
//   public DataSource dataSource;
//   public int size;
//   public Flavor flavor;
//   public Closeable poolShutdown;
// 
//   public Pool(DataSource dataSource, int size, Flavor flavor, Closeable poolShutdown) {
//     this.dataSource = dataSource;
//     this.size = size;
//     this.flavor = flavor;
//     this.poolShutdown = poolShutdown;
//   }
// }


// Path: src/main/java/com/github/susom/database/DatabaseProviderVertx.java
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.WorkerExecutor;
import java.io.Closeable;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Supplier;
import javax.annotation.CheckReturnValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.susom.database.DatabaseProvider.Pool;

   *                          url; prompted on standard input if user is provided and
   *                          password is not)
   *   database.pool.size=... How many connections in the connection pool (default 10).
   *   database.driver.class  The driver to initialize with Class.forName(). This will
   *                          be guessed from the database.url if not provided.
   *   database.flavor        One of the enumerated values in {@link Flavor}. If this
   *                          is not provided the flavor will be guessed based on the
   *                          value for database.url, if possible.
   * </pre>
   *
   * <p>The database flavor will be guessed based on the URL.</p>
   *
   * <p>A database pool will be created using HikariCP.</p>
   *
   * <p>Be sure to retain a copy of the builder so you can call close() later to
   * destroy the pool. You will most likely want to register a JVM shutdown hook
   * to make sure this happens. See VertxServer.java in the demo directory for
   * an example of how to do this.</p>
   */
  @CheckReturnValue
  public static Builder pooledBuilder(Vertx vertx, Config config) {
    return fromPool(vertx, DatabaseProvider.createPool(config));
  }

  /**
   * Use an externally configured DataSource, Flavor, and optionally a shutdown hook.
   * The shutdown hook may be null if you don't want calls to Builder.close() to attempt
   * any shutdown. The DataSource and Flavor are mandatory.
   */
  @CheckReturnValue
  public static Builder fromPool(Vertx vertx, Pool pool) {