// index start from 1 // /*!cobar: $dataNodeId=0.0, $_table='offer'*/ // /*!cobar: $dataNodeId=[0,1,5.2], $_table='offer'*/ // /*!cobar: $_partitionOperand=('member_id'='m1'), $_table='offer'*/ // /*!cobar: $_partitionOperand=('member_id'=['m1','m2']), $_table='offer', // $_replica=2*/ // /*!cobar: $_partitionOperand=(['offer_id','group_id']=[123,'3c']), // $_table='offer'*/ // /*!cobar: // $_partitionOperand=(['offer_id','group_id']=[[123,'3c'],[234,'food']]), // $_table='offer'*/ /// <param name="offset"> /// index of first char of /// <see cref="CobarHintPrefix" /> /// </param> /// <exception cref="System.SqlSyntaxErrorException" /> public static CobarHint ParserCobarHint(string sql, int offset) { var hint = new CobarHint { CurrentIndex = offset + CobarHintPrefix.Length }; hint.Parse(sql); return(hint); }
// index start from 1 // /*!cobar: $dataNodeId=0.0, $_table='offer'*/ // /*!cobar: $dataNodeId=[0,1,5.2], $_table='offer'*/ // /*!cobar: $_partitionOperand=('member_id'='m1'), $_table='offer'*/ // /*!cobar: $_partitionOperand=('member_id'=['m1','m2']), $_table='offer', // $_replica=2*/ // /*!cobar: $_partitionOperand=(['offer_id','group_id']=[123,'3c']), // $_table='offer'*/ // /*!cobar: // $_partitionOperand=(['offer_id','group_id']=[[123,'3c'],[234,'food']]), // $_table='offer'*/ /// <param name="offset"> /// index of first char of /// <see cref="CobarHintPrefix" /> /// </param> /// <exception cref="System.SqlSyntaxErrorException" /> public static CobarHint ParserCobarHint(string sql, int offset) { var hint = new CobarHint { CurrentIndex = offset + CobarHintPrefix.Length }; hint.Parse(sql); return hint; }