예제 #1
0
        public void Create()
        {
            List <string> cqls = CqlQueryTools.GetCreateCQL(this, false);

            foreach (string cql in cqls)
            {
                _session.WaitForSchemaAgreement(_session.Execute(cql));
            }
        }
예제 #2
0
        public void Create()
        {
            var cqls = CqlQueryTools.GetCreateCQL(this);

            foreach (var cql in cqls)
            {
                _session.WaitForSchemaAgreement(_session.Execute(cql));
            }
        }
예제 #3
0
        public void Create(ConsistencyLevel consictencyLevel = ConsistencyLevel.Default)
        {
            var cqls = CqlQueryTools.GetCreateCQL(this);

            foreach (var cql in cqls)
            {
                _session.Cluster.WaitForSchemaAgreement(_session.Execute(cql, consictencyLevel).QueriedHost);
            }
        }
예제 #4
0
 public void CreateIfNotExists()
 {
     if (_session.BinaryProtocolVersion > 1)
     {
         List <string> cqls = CqlQueryTools.GetCreateCQL(this, true);
         foreach (string cql in cqls)
         {
             _session.WaitForSchemaAgreement(_session.Execute(cql));
         }
     }
     else
     {
         try
         {
             Create();
         }
         catch (AlreadyExistsException)
         {
             //do nothing
         }
     }
 }