示例#1
0
        public CqlType CreateType(TypeParser parser)
        {
            string keyspace = parser.ReadNextIdentifier();
            parser.SkipBlankAndComma();
            string name = parser.ReadNextIdentifier().DecodeHex();

            var fieldNames = new List<string>();
            var fieldTypes = new List<CqlType>();

            while(parser.SkipBlankAndComma())
            {
                if(parser.Peek() == ')')
                    return CreateTypeInternal(keyspace, name, fieldNames, fieldTypes, null);

                string fieldName = parser.ReadNextIdentifier().DecodeHex();

                if(parser.ReadNextChar() != ':')
                    throw new CqlException("Error parsing UserType arguments: ':' expected after fieldName.");

                CqlType type = parser.ReadCqlType();

                fieldNames.Add(fieldName);
                fieldTypes.Add(type);
            }

            throw new CqlException("Error parsing UserType arguments: unexpected end of string.");
        }
示例#2
0
        public CqlType CreateType(TypeParser parser)
        {
            var keyType = parser.ReadCqlType();

            if(parser.ReadNextChar() != ',')
                throw new CqlException("Expected a ',' during parsing of a map type");

            var valueType = parser.ReadCqlType();

            return CreateType(keyType, valueType);
        }
示例#3
0
        public CqlType CreateType(TypeParser parser)
        {
            var types = new List<CqlType>();
            parser.SkipBlank();
            while(!parser.IsEOS() && parser.Peek() != ')')
            {
                types.Add(parser.ReadCqlType());
                parser.SkipBlankAndComma();
            }

            return CreateType(types);
        }
示例#4
0
 public CqlType CreateType(TypeParser parser)
 {
     var innerType = parser.ReadCqlType();
     return CreateType(innerType);
 }
示例#5
0
 public CqlType CreateType(TypeParser parser)
 {
     return UUIDType.Instance;
 }
示例#6
0
 public CqlType CreateType(TypeParser parser)
 {
     return BytesType.Instance;
 }
示例#7
0
 public CqlType CreateType(TypeParser parser)
 {
     return DecimalType.Instance;
 }
示例#8
0
 public CqlType CreateType(TypeParser parser)
 {
     return TimestampType.Instance;
 }
 public CqlType CreateType(TypeParser parser)
 {
     return CounterColumnType.Instance;
 }
示例#10
0
 public CqlType CreateType(TypeParser parser)
 {
     return Int32Type.Instance;
 }
示例#11
0
 public CqlType CreateType(TypeParser parser)
 {
     return AsciiType.Instance;
 }
示例#12
0
 public CqlType CreateType(TypeParser parser)
 {
     return FloatType.Instance;
 }
示例#13
0
 public CqlType CreateType(TypeParser parser)
 {
     return InetAddressType.Instance;
 }
示例#14
0
 public CqlType CreateType(TypeParser parser)
 {
     return BooleanType.Instance;
 }
示例#15
0
 public CqlType CreateType(TypeParser parser)
 {
     throw new NotSupportedException("Anonymous types can't be parsed. (As they have no Cassandra counterpart)");
 }