// Path: vertx-mysql-postgresql-client-scala/src/main/java/io/vertx/ext/asyncsql/impl/ClientHelper.java
// public class ClientHelper {
// 
//   private static final String DS_LOCAL_MAP_NAME_BASE = "__vertx.MySQLPostgreSQL.pools.";
// 
//   public static AsyncSQLClient getOrCreate(Vertx vertx, JsonObject config, String poolName, boolean
//       mySQL) {
//     synchronized (vertx) {
//       LocalMap<String, ClientHolder> map = vertx.sharedData().getLocalMap(
//           DS_LOCAL_MAP_NAME_BASE + (mySQL ? "MySQL" : "PostgreSQL"));
// 
//       ClientHolder theHolder = map.get(poolName);
//       if (theHolder == null) {
//         theHolder = new ClientHolder(vertx, config, mySQL, () -> removeFromMap(vertx, map, poolName));
//         map.put(poolName, theHolder);
//       } else {
//         theHolder.incRefCount();
//       }
//       return new ClientWrapper(theHolder);
//     }
//   }
// 
//   private static void removeFromMap(Vertx vertx, LocalMap<String, ClientHolder> map, String poolName) {
//     synchronized (vertx) {
//       map.remove(poolName);
//       if (map.isEmpty()) {
//         map.close();
//       }
//     }
//   }
// 
// }


import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.asyncsql.impl.ClientHelper;
import io.vertx.ext.sql.SQLClient;
import java.util.UUID;
/*
 *  Copyright 2015 Red Hat, Inc.
 *
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  and Apache License v2.0 which accompanies this distribution.
 *
 *  The Eclipse Public License is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  The Apache License v2.0 is available at
 *  http://www.opensource.org/licenses/apache2.0.php
 *
 *  You may elect to redistribute this code under either of these licenses.
 */

package io.vertx.ext.asyncsql;



/**
 * Represents an PostgreSQL client
 *
 * @author <a href="http://www.campudus.com">Joern Bernhardt</a>.
 * @author <a href="http://tfox.org">Tim Fox</a>
 */
@VertxGen
public interface PostgreSQLClient extends AsyncSQLClient {

  /**
   * The default name used for the PostGreSQL pool.
   */
// Path: vertx-mysql-postgresql-client-scala/src/main/java/io/vertx/ext/asyncsql/impl/ClientHelper.java
// public class ClientHelper {
// 
//   private static final String DS_LOCAL_MAP_NAME_BASE = "__vertx.MySQLPostgreSQL.pools.";
// 
//   public static AsyncSQLClient getOrCreate(Vertx vertx, JsonObject config, String poolName, boolean
//       mySQL) {
//     synchronized (vertx) {
//       LocalMap<String, ClientHolder> map = vertx.sharedData().getLocalMap(
//           DS_LOCAL_MAP_NAME_BASE + (mySQL ? "MySQL" : "PostgreSQL"));
// 
//       ClientHolder theHolder = map.get(poolName);
//       if (theHolder == null) {
//         theHolder = new ClientHolder(vertx, config, mySQL, () -> removeFromMap(vertx, map, poolName));
//         map.put(poolName, theHolder);
//       } else {
//         theHolder.incRefCount();
//       }
//       return new ClientWrapper(theHolder);
//     }
//   }
// 
//   private static void removeFromMap(Vertx vertx, LocalMap<String, ClientHolder> map, String poolName) {
//     synchronized (vertx) {
//       map.remove(poolName);
//       if (map.isEmpty()) {
//         map.close();
//       }
//     }
//   }
// 
// }


// Path: vertx-mysql-postgresql-client-scala/src/main/java/io/vertx/ext/asyncsql/PostgreSQLClient.java
import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.asyncsql.impl.ClientHelper;
import io.vertx.ext.sql.SQLClient;
import java.util.UUID;

/*
 *  Copyright 2015 Red Hat, Inc.
 *
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  and Apache License v2.0 which accompanies this distribution.
 *
 *  The Eclipse Public License is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  The Apache License v2.0 is available at
 *  http://www.opensource.org/licenses/apache2.0.php
 *
 *  You may elect to redistribute this code under either of these licenses.
 */

package io.vertx.ext.asyncsql;



/**
 * Represents an PostgreSQL client
 *
 * @author <a href="http://www.campudus.com">Joern Bernhardt</a>.
 * @author <a href="http://tfox.org">Tim Fox</a>
 */
@VertxGen
public interface PostgreSQLClient extends AsyncSQLClient {

  /**
   * The default name used for the PostGreSQL pool.
   */
  String DEFAULT_DS_NAME = "DEFAULT_POSTGRESQL_DS";