public RouteResult Route(ShardingRule shardingRule)
 {
     if (IsDMLForModify(SqlCommandContext) && 1 != ((ITableAvailable)SqlCommandContext).GetAllTables().Count)
     {
         throw new ShardingException($"Cannot support Multiple-Table for '{SqlCommandContext.GetSqlCommand()}'.");
     }
     return(GenerateRouteResult(GetDataNodes(shardingRule, shardingRule.GetTableRule(LogicTableName))));
 }
Example #2
0
        public ICommandContext CreateCommand(string text, CommandType commandType, ITransaction transaction)
        {
            var command = new SqlCommandContext(Connection, text, commandType, transaction);

            return command;
        }
Example #3
0
        public ICommandContext CreateCommand(string text)
        {
            var command = new SqlCommandContext(Connection, text, CommandType.StoredProcedure);

            return command;
        }