What C# type is equivalent to the timeuuid in the Datastax Cassandra C# driver?
I am writing a simple user tracking service and want to access the most latest user history. I am trying to create a table equivalent to this create statement:
CREATE TABLE IF NOT EXISTS user_history (
user_id text,
event_type text,
create_date timeuuid,
item_id text,
PRIMARY KEY ((user_id, event_type), create_date)
);
I have made the following class:
[AllowFiltering]
[Table("user_history")]
public class UserHistory
{
[PartitionKey(1)]
[Column("user_id")]
public string UserID;
[PartitionKey(2)]
[Column("event_type")]
public string EventType;
[ClusteringKey(1)]
[Column("create_date")]
public DateTime CreateDate { get; set; }
[Column("item_id")]
public string ItemID;
}
And I am using this statement to create the table in Cassandra:
var table = Session.GetTable<UserHistory>();
table.CreateIfNotExists();
But this gives me the following table:
CREATE TABLE user_history (
user_id text,
event_type text,
create_date timestamp,
item_id text,
PRIMARY KEY ((user_id, event_type), create_date)
)
As you can see, the type of create_date is timestamp instead of timeuuid.
I have tried Guid instead of DateTime, but that gives me an uuid when I am calling .CreateIfNotExists().
Should I use Guid instead of DateTime for the CreateDate and create the table explicit using raw CQL3? I guess this will allow me to read and write timeuuid from/to Cassandra (using the GuidGenerator found in the FluentCassandra project)?! (Recall: I am using the Datastax driver)