boolean insertMany(Connection c, String key, Iterable<Object[]> list) throws PalantirSqlException { return basicSql.insertMany( c, SQLString.getByKey(key, c), Iterables.toArray(list, Object[].class)); }
/** * Returns the long value of the first field selected given a query. If no rows are returned, * will throw SQLException. * <p> * If the value of the first field is null then 0 will be returned in prod, but an assert will * be thrown in test. */ long selectLong(Connection c, String key, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal(c, SQLString.getByKey(key, c), vs, null, true); }
/** * Returns the long value of the first field selected given a query If no rows are returned, * will return defaultVal. * <p> * If the value of the first field is null, then defaultVal will be returned. This means that if * defaultVal is non-null, then this method won't return null. */ Long selectLongWithDefault(Connection c, String key, Long defaultVal, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal(c, SQLString.getByKey(key, c), vs, defaultVal, false); }
int selectInteger(Connection c, String key, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectIntegerInternal(c, SQLString.getByKey(key, c), vs); }
AgnosticLightResultSet selectLightResultSet(Connection c, String key, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return selectLightResultSet(c, SQLString.getByKey(key, c), vs); }
static FinalSQLString getByKey(String key, Connection connection) throws PalantirSqlException { DBType type = DBType.getTypeFromConnection(connection); return getByKey(key, type); }
boolean selectExists(Connection c, String key, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectExistsInternal(c, SQLString.getByKey(key, c), vs); }
boolean update(Connection c, String key, Object... vs) throws PalantirSqlException { basicSql.updateInternal(c, SQLString.getByKey(key, c), vs, AutoClose.TRUE); return true; }
PreparedStatement execute(Connection c, String key, Object... vs) throws PalantirSqlException { return basicSql.execute(c, SQLString.getByKey(key, c), vs, AutoClose.TRUE); }
int updateCountRows(Connection c, String key, Object... vs) throws PalantirSqlException { return basicSql.updateCountRowsInternal(c, SQLString.getByKey(key, c), vs); }
void updateMany(Connection c, String key, Iterable<Object[]> list) throws PalantirSqlException { basicSql.updateMany(c, SQLString.getByKey(key, c), Iterables.toArray(list, Object[].class)); }
int insertOneCountRows(Connection c, String key, Object... vs) throws PalantirSqlException { return basicSql.insertOneCountRowsInternal(c, SQLString.getByKey(key, c), vs); }
public int executeCountRows(Connection c, String key, Object... vs) throws PalantirSqlException { return executeCountRows(c, SQLString.getByKey(key, c), vs); }
AgnosticResultSet selectResultSet(Connection c, String key, Object... vs) throws PalantirSqlException, PalantirInterruptedException { DBType dbType = DBType.getTypeFromConnection(c); return basicSql.selectResultSetSpecifyingDBType( c, SQLString.getByKey(key, dbType), vs, dbType); }
AgnosticLightResultSet selectLightResultSet(Connection c, RegisteredSQLString sql, Object... vs) throws PalantirSqlException, PalantirInterruptedException { DBType dbType = DBType.getTypeFromConnection(c); return basicSql.selectLightResultSetSpecifyingDBType( c, SQLString.getByKey(sql.getKey(), dbType), vs, dbType, null); }
/** * Returns the long value of the first field selected given a query If no rows are returned, * will return defaultVal. * <p> * If the value of the first field is null, then defaultVal will be returned. This means that if * defaultVal is non-null, then this method won't return null. */ Long selectLongWithDefault(Connection c, String key, Long defaultVal, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal(c, SQLString.getByKey(key, c), vs, defaultVal, false); }
boolean insertMany(Connection c, String key, Iterable<Object[]> list) throws PalantirSqlException { return basicSql.insertMany( c, SQLString.getByKey(key, c), Iterables.toArray(list, Object[].class)); }
/** * Returns the long value of the first field selected given a query. If no rows are returned, * will throw SQLException. * <p> * If the value of the first field is null then 0 will be returned in prod, but an assert will * be thrown in test. */ long selectLong(Connection c, String key, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal(c, SQLString.getByKey(key, c), vs, null, true); }
AgnosticResultSet selectResultSet(Connection c, String key, Object... vs) throws PalantirSqlException, PalantirInterruptedException { DBType dbType = DBType.getTypeFromConnection(c); return basicSql.selectResultSetSpecifyingDBType( c, SQLString.getByKey(key, dbType), vs, dbType); }
AgnosticLightResultSet selectLightResultSet(Connection c, RegisteredSQLString sql, Object... vs) throws PalantirSqlException, PalantirInterruptedException { DBType dbType = DBType.getTypeFromConnection(c); return basicSql.selectLightResultSetSpecifyingDBType( c, SQLString.getByKey(sql.getKey(), dbType), vs, dbType, null); }