/// <summary>
 /// Initializes a new instance of <see cref="SpannerCommand"/>
 /// </summary>
 /// <param name="commandText">If this command is a SQL Query, then commandText is
 /// the SQL statement. If its an update, insert or delete command, then this text
 /// is "[operation] [table]" such as "UPDATE MYTABLE"</param>. Must not be null.
 /// <param name="connection">The <see cref="SpannerConnection"/> that is
 /// associated with this <see cref="SpannerCommand"/>. Must not be null.</param>
 /// <param name="transaction">An optional <see cref="SpannerTransaction"/>
 /// created through <see>
 /// <cref>SpannerConnection.BeginTransactionAsync</cref></see>. May be null.</param>
 /// <param name="parameters">An optional collection of <see cref="SpannerParameter"/>
 /// that is used in the command. May be null.</param>
 public SpannerCommand(
     string commandText,
     SpannerConnection connection,
     SpannerTransaction transaction        = null,
     SpannerParameterCollection parameters = null)
     : this(SpannerCommandTextBuilder.FromCommandText(commandText), connection, transaction, parameters)
 {
 }
Exemplo n.º 2
0
 internal SpannerCommand(string commandText, SpannerParameterCollection parameters = null)
 {
     SpannerCommandTextBuilder = SpannerCommandTextBuilder.FromCommandText(commandText);
     if (parameters != null)
     {
         Parameters = parameters;
     }
 }
Exemplo n.º 3
0
 private SpannerCommand(
     SpannerConnection connection,
     SpannerTransaction transaction,
     SpannerParameterCollection parameters) : this()
 {
     SpannerConnection = connection;
     _transaction      = transaction;
     Parameters        = parameters;
 }
 public ExecutableCommand(SpannerCommand command)
 {
     Connection         = command.SpannerConnection;
     CommandTextBuilder = command.SpannerCommandTextBuilder;
     CommandTimeout     = command.CommandTimeout;
     Partition          = command.Partition;
     Parameters         = command.Parameters;
     Transaction        = command._transaction;
 }
        /// <summary>
        /// Initializes a new instance of <see cref="SpannerCommand"/>.
        /// </summary>
        /// <param name="commandTextBuilder">The <see cref="SpannerCommandTextBuilder"/>
        /// that configures the text of this command. Must not be null.</param>
        /// <param name="connection">The <see cref="SpannerConnection"/> that is
        /// associated with this <see cref="SpannerCommand"/>. Must not be null.</param>
        /// <param name="transaction">An optional <see cref="SpannerTransaction"/>
        /// created through <see>
        /// <cref>SpannerConnection.BeginTransactionAsync</cref>
        /// </see>
        /// </param>. May be null.
        /// <param name="parameters">An optional collection of <see cref="SpannerParameter"/>
        /// that is used in the command. May be null.</param>
        public SpannerCommand(
            SpannerCommandTextBuilder commandTextBuilder,
            SpannerConnection connection,
            SpannerTransaction transaction        = null,
            SpannerParameterCollection parameters = null)
            : this(connection, transaction, parameters)
        {
            GaxPreconditions.CheckNotNull(commandTextBuilder, nameof(commandTextBuilder));
            GaxPreconditions.CheckNotNull(connection, nameof(connection));

            SpannerCommandTextBuilder = commandTextBuilder;
        }
Exemplo n.º 6
0
 private SpannerCommand(
     SpannerConnection connection,
     SpannerTransaction transaction,
     SpannerParameterCollection parameters,
     CommandPartition commandPartition) : this(connection)
 {
     _transaction = transaction;
     Partition    = commandPartition;
     if (parameters != null)
     {
         Parameters = parameters;
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// Creates a new key set from a collection of parameters that represent exactly one key.
 /// </summary>
 /// <param name="parameters">A parameter collection containing the values of the key</param>
 /// <returns>A key set for one specific key</returns>
 public static KeySet FromParameters(SpannerParameterCollection parameters) => FromKeys(new Key(parameters));