本文整理汇总了C#中ISession.CreateKeyspace方法的典型用法代码示例。如果您正苦于以下问题:C# ISession.CreateKeyspace方法的具体用法?C# ISession.CreateKeyspace怎么用?C# ISession.CreateKeyspace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISession
的用法示例。
在下文中一共展示了ISession.CreateKeyspace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupTest
public void SetupTest()
{
_session = TestClusterManager.GetTestCluster(1).Session;
_uniqueKsName = TestUtils.GetUniqueKeyspaceName();
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
}
示例2: SetupTest
public void SetupTest()
{
_session = Session;
_uniqueKsName = TestUtils.GetUniqueKeyspaceName();
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
}
示例3: TestFixtureSetUp
protected override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
// Create necessary tables
MappingConfiguration config1 = new MappingConfiguration();
config1.MapperFactory.PocoDataFactory.AddDefinitionDefault(typeof (EntityWithTimeUuid),
() => LinqAttributeBasedTypeDefinition.DetermineAttributes(typeof (EntityWithTimeUuid)));
_tableEntityWithTimeUuid = new Table<EntityWithTimeUuid>(_session, config1);
_tableEntityWithTimeUuid.Create();
MappingConfiguration config2 = new MappingConfiguration();
config2.MapperFactory.PocoDataFactory.AddDefinitionDefault(typeof (EntityWithNullableTimeUuid),
() => LinqAttributeBasedTypeDefinition.DetermineAttributes(typeof (EntityWithNullableTimeUuid)));
_tableEntityWithNullableTimeUuid = new Table<EntityWithNullableTimeUuid>(_session, config2);
_tableEntityWithNullableTimeUuid.Create();
_expectedTimeUuidObjectList = EntityWithTimeUuid.GetDefaultObjectList();
for (int i=0; i<_expectedTimeUuidObjectList.Count; i++)
{
_expectedTimeUuidObjectList[i].StringType = i.ToString();
}
}
示例4: TestFixtureSetUp
protected override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
// Create necessary tables
MappingConfiguration config1 = new MappingConfiguration();
config1.MapperFactory.PocoDataFactory.AddDefinitionDefault(typeof(EntityWithTimeUuid),
() => LinqAttributeBasedTypeDefinition.DetermineAttributes(typeof(EntityWithTimeUuid)));
_tableEntityWithTimeUuid = new Table<EntityWithTimeUuid>(_session, config1);
_tableEntityWithTimeUuid.Create();
MappingConfiguration config2 = new MappingConfiguration();
config2.MapperFactory.PocoDataFactory.AddDefinitionDefault(typeof(EntityWithNullableTimeUuid),
() => LinqAttributeBasedTypeDefinition.DetermineAttributes(typeof(EntityWithNullableTimeUuid)));
_tableEntityWithNullableTimeUuid = new Table<EntityWithNullableTimeUuid>(_session, config2);
_tableEntityWithNullableTimeUuid.Create();
_expectedTimeUuidObjectList = EntityWithTimeUuid.GetDefaultObjectList();
_expectedNullableTimeUuidObjectList = EntityWithNullableTimeUuid.GetDefaultObjectList();
_dateBefore = DateTimeOffset.Parse("2014-2-1");
_dateAfter = DateTimeOffset.Parse("2014-4-1");
}
示例5: TestFixtureSetUp
protected override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_session = Session;
_uniqueKsName = TestUtils.GetUniqueKeyspaceName();
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
}
示例6: SetupTest
public void SetupTest()
{
_session = TestClusterManager.GetTestCluster(1).Session;
_uniqueKsName = TestUtils.GetUniqueKeyspaceName();
_session.CreateKeyspace(_uniqueKsName);
TestUtils.WaitForSchemaAgreement(_session.Cluster);
_session.ChangeKeyspace(_uniqueKsName);
}
示例7: SetupTest
public void SetupTest()
{
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
_entityList = AllDataTypesEntity.SetupDefaultTable(_session);
}
示例8: TestFixtureSetUp
public void TestFixtureSetUp()
{
var testCluster = TestClusterManager.GetTestCluster(1);
_cluster = Cluster.Builder().AddContactPoint(testCluster.InitialContactPoint).Build();
_session = _cluster.Connect();
_uniqueKsName = TestUtils.GetUniqueKeyspaceName();
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
}
示例9: TestFixtureSetUp
protected override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
_movieTable = new Table<Movie>(_session, new MappingConfiguration());
_movieTable.Create();
}
示例10: TestFixtureSetUp
protected override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
_entityList = AllDataTypesEntity.SetupDefaultTable(_session);
_table = new Table<AllDataTypesEntity>(_session, new MappingConfiguration());
}
示例11: SetupTest
public void SetupTest()
{
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
_entityList = AllDataTypesEntity.SetupDefaultTable(_session);
_table = new Table<AllDataTypesEntity>(_session, new MappingConfiguration());
}
示例12: TestFixtureSetUp
public void TestFixtureSetUp()
{
var testCluster = TestClusterManager.GetTestCluster(1, DefaultMaxClusterCreateRetries, true, false);
_cluster = Cluster.Builder().AddContactPoint(testCluster.InitialContactPoint).Build();
_session = _cluster.Connect();
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
_movieTable = new Table<Movie>(_session, new MappingConfiguration());
_movieTable.Create();
}
示例13: TestFixtureSetUp
protected override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_session = Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
// drop table if exists, re-create
var table = _session.GetTable<Movie>();
table.Create();
//Insert some data
foreach (var movie in _movieList)
table.Insert(movie).Execute();
}
示例14: SetupTest
public void SetupTest()
{
_session = TestClusterManager.GetTestCluster(1).Session;
_session.CreateKeyspace(_uniqueKsName);
_session.ChangeKeyspace(_uniqueKsName);
// drop table if exists, re-create
var config = new Map<Movie>().PartitionKey(c => c.MovieMaker);
var mappingConfig = new MappingConfiguration().Define(config);
_mapper = new Mapper(_session, mappingConfig);
_movieTable = new Table<Movie>(_session, mappingConfig);
_movieTable.Create();
//Insert some data
foreach (var movie in _movieList)
_movieTable.Insert(movie).Execute();
}
示例15: SetupSessionAndCluster
private ITestCluster SetupSessionAndCluster(int nodes, Dictionary<string, string> replication = null)
{
ITestCluster testCluster = TestClusterManager.GetTestCluster(nodes);
_session = testCluster.Session;
_ksName = TestUtils.GetUniqueKeyspaceName();
_session.CreateKeyspace(_ksName, replication);
TestUtils.WaitForSchemaAgreement(_session.Cluster);
_session.ChangeKeyspace(_ksName);
_table = new Table<ManyDataTypesEntity>(_session, new MappingConfiguration());
_table.Create();
_defaultPocoList = ManyDataTypesEntity.GetDefaultAllDataTypesList();
_preparedStatement = _session.Prepare(_preparedInsertStatementAsString);
foreach (var manyDataTypesEntity in _defaultPocoList)
_session.Execute(GetBoundInsertStatementBasedOnEntity(manyDataTypesEntity));
return testCluster;
}