protected override long GetNewLowValue() { // TODO: Parameterize query and/or delimit identifier without using SqlServerMigrationOperationSqlGenerator var sql = string.Format(CultureInfo.InvariantCulture, "SELECT NEXT VALUE FOR {0}", _sequenceName); var nextValue = _executor.ExecuteScalar(_connection, _connection.DbTransaction, sql); return((long)Convert.ChangeType(nextValue, typeof(long), CultureInfo.InvariantCulture)); }
protected override bool HasTables() { var count = (long)SqlStatementExecutor.ExecuteScalar( Connection, "SELECT COUNT(*) FROM \"sqlite_master\" WHERE \"type\" = 'table' AND \"rootpage\" IS NOT NULL;"); return(count != 0); }
public override long GetNewCurrentValue(StateEntry stateEntry, IProperty property) { Check.NotNull(stateEntry, "stateEntry"); Check.NotNull(property, "property"); var commandInfo = PrepareCommand(stateEntry.Configuration); var nextValue = _executor.ExecuteScalar(commandInfo.Item1.DbConnection, commandInfo.Item1.DbTransaction, commandInfo.Item2); return((long)Convert.ChangeType(nextValue, typeof(long), CultureInfo.InvariantCulture)); }
protected override long GetNewCurrentValue(IProperty property, DbContextService <DataStoreServices> dataStoreServices) { Check.NotNull(property, "property"); Check.NotNull(dataStoreServices, "dataStoreServices"); var commandInfo = PrepareCommand((RelationalConnection)dataStoreServices.Service.Connection); var nextValue = _executor.ExecuteScalar(commandInfo.Item1.DbConnection, commandInfo.Item1.DbTransaction, commandInfo.Item2); return((long)Convert.ChangeType(nextValue, typeof(long), CultureInfo.InvariantCulture)); }
public override bool HasTables() { return((long)_executor.ExecuteScalar(_connection.DbConnection, _connection.DbTransaction, CreateHasTablesCommand()) != 0); }
public override bool HasTables() => (int)_statementExecutor.ExecuteScalar(_connection, _connection.DbTransaction, CreateHasTablesCommand()) != 0;
public override bool HasTables() { return((int)_statementExecutor.ExecuteScalar(_connection.DbConnection, CreateHasTablesCommand()) != 0); }
protected override bool HasTables() => (int)SqlStatementExecutor.ExecuteScalar(_connection, CreateHasTablesCommand()) != 0;