Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Commit

Permalink
The ConnectionDefault setting was confusing for CqlVersion so now
Browse files Browse the repository at this point in the history
ull is just being used instead to imply ConnectionDefault
  • Loading branch information
Nick Berardi committed Jan 25, 2013
1 parent d5d1b4b commit 4fa9572
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/CassandraContext.cs
Expand Up @@ -323,7 +323,7 @@ public void SaveChanges(IFluentRecord record, bool atomic = true)
///
/// </summary>
/// <param name="cqlQuery"></param>
public IEnumerable<ICqlRow> ExecuteQuery(UTF8Type cqlQuery, string cqlVersion = CqlVersion.ConnectionDefault)
public IEnumerable<ICqlRow> ExecuteQuery(UTF8Type cqlQuery, string cqlVersion = null)
{
var op = new ExecuteCqlQuery(cqlQuery, cqlVersion);
return ExecuteOperation(op);
Expand All @@ -333,7 +333,7 @@ public IEnumerable<ICqlRow> ExecuteQuery(UTF8Type cqlQuery, string cqlVersion =
///
/// </summary>
/// <param name="cqlQuery"></param>
public void TryExecuteNonQuery(UTF8Type cqlQuery, string cqlVersion = CqlVersion.ConnectionDefault)
public void TryExecuteNonQuery(UTF8Type cqlQuery, string cqlVersion = null)
{
try {
ExecuteNonQuery(cqlQuery, cqlVersion);
Expand All @@ -346,7 +346,7 @@ public void TryExecuteNonQuery(UTF8Type cqlQuery, string cqlVersion = CqlVersion
///
/// </summary>
/// <param name="cqlQuery"></param>
public void ExecuteNonQuery(UTF8Type cqlQuery, string cqlVersion = CqlVersion.ConnectionDefault)
public void ExecuteNonQuery(UTF8Type cqlQuery, string cqlVersion = null)
{
var op = new ExecuteCqlNonQuery(cqlQuery, cqlVersion);
ExecuteOperation(op);
Expand Down
4 changes: 2 additions & 2 deletions src/Connections/ConnectionBuilder.cs
Expand Up @@ -14,7 +14,7 @@ public class ConnectionBuilder : FluentCassandra.Connections.IConnectionBuilder
/// <param name="host"></param>
/// <param name="port"></param>
/// <param name="timeout"></param>
public ConnectionBuilder(string keyspace, string host, int port = Server.DefaultPort, int connectionTimeout = Server.DefaultTimeout, bool pooling = false, int minPoolSize = 0, int maxPoolSize = 100, int maxRetries = 0, int serverPollingInterval = 30, int connectionLifetime = 0, ConnectionType connectionType = ConnectionType.Framed, int bufferSize = 1024, ConsistencyLevel read = ConsistencyLevel.QUORUM, ConsistencyLevel write = ConsistencyLevel.QUORUM, string cqlVersion = FluentCassandra.Connections.CqlVersion.ConnectionDefault , bool compressCqlQueries = true, string username = null, string password = null)
public ConnectionBuilder(string keyspace, string host, int port = Server.DefaultPort, int connectionTimeout = Server.DefaultTimeout, bool pooling = false, int minPoolSize = 0, int maxPoolSize = 100, int maxRetries = 0, int serverPollingInterval = 30, int connectionLifetime = 0, ConnectionType connectionType = ConnectionType.Framed, int bufferSize = 1024, ConsistencyLevel read = ConsistencyLevel.QUORUM, ConsistencyLevel write = ConsistencyLevel.QUORUM, string cqlVersion = FluentCassandra.Connections.CqlVersion.Edge , bool compressCqlQueries = true, string username = null, string password = null)
{
Keyspace = keyspace;
Servers = new List<Server>() { new Server(host, port) };
Expand All @@ -37,7 +37,7 @@ public ConnectionBuilder(string keyspace, string host, int port = Server.Default
ConnectionString = GetConnectionString();
}

public ConnectionBuilder(string keyspace, Server server, bool pooling = false, int minPoolSize = 0, int maxPoolSize = 100, int maxRetries = 0, int serverPollingInterval = 30, int connectionLifetime = 0, ConnectionType connectionType = ConnectionType.Framed, int bufferSize = 1024, ConsistencyLevel read = ConsistencyLevel.QUORUM, ConsistencyLevel write = ConsistencyLevel.QUORUM, string cqlVersion = FluentCassandra.Connections.CqlVersion.ConnectionDefault, bool compressCqlQueries = true, string username = null, string password = null)
public ConnectionBuilder(string keyspace, Server server, bool pooling = false, int minPoolSize = 0, int maxPoolSize = 100, int maxRetries = 0, int serverPollingInterval = 30, int connectionLifetime = 0, ConnectionType connectionType = ConnectionType.Framed, int bufferSize = 1024, ConsistencyLevel read = ConsistencyLevel.QUORUM, ConsistencyLevel write = ConsistencyLevel.QUORUM, string cqlVersion = FluentCassandra.Connections.CqlVersion.Edge, bool compressCqlQueries = true, string username = null, string password = null)
{
Keyspace = keyspace;
Servers = new List<Server>() { server };
Expand Down
1 change: 0 additions & 1 deletion src/Connections/CqlVersion.cs
Expand Up @@ -8,7 +8,6 @@ public static class CqlVersion
public const string Cql = "2.0.0";
public const string Cql3 = "3.0.0";
public const string Edge = Cql3;
public const string ConnectionDefault = null;

[Obsolete("This is no longer supported, please use ConnectionDefault", error: true)]
public const string ServerDefault = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Operations/ExecuteCqlNonQuery.cs
Expand Up @@ -20,7 +20,7 @@ public override Void Execute()
if (isCqlQueryCompressed)
query = Helper.ZlibCompress(query);

if (CqlVersion == FluentCassandra.Connections.CqlVersion.ConnectionDefault)
if (CqlVersion == null)
CqlVersion = Session.ConnectionBuilder.CqlVersion;

var client = Session.GetClient();
Expand Down
2 changes: 1 addition & 1 deletion src/Operations/ExecuteCqlQuery.cs
Expand Up @@ -40,7 +40,7 @@ public override IEnumerable<ICqlRow> Execute()
if (isCqlQueryCompressed)
query = Helper.ZlibCompress(query);

if (CqlVersion == FluentCassandra.Connections.CqlVersion.ConnectionDefault)
if (CqlVersion == null)
CqlVersion = Session.ConnectionBuilder.CqlVersion;

var client = Session.GetClient();
Expand Down

0 comments on commit 4fa9572

Please sign in to comment.