Questions tagged [cqlengine]

Cassandra CQL Object Mapper for Python

cqlengine is a Cassandra CQL 3 Object Mapper for Python. cqlengine is part of the Datastax python driver for Cassandra

Related links:

72 questions
2
votes
1 answer

cassandra cqlengine map column index on key

Using the Cassandra python driver mapper, cqlengine, when creating a model with a map collection it seems it is only possible to create an Index on the map values class Foo(Model): id = columns.UUID(partition_key=True) time_id =…
Richard Mathie
  • 306
  • 3
  • 6
2
votes
2 answers

Cqlengine queries: how to return dictionary?

I'm using cqlengine in Django application, where Cassandra is the secondary database. In some cases I need to join manually the results of SQL and NoSQL database requests. For SQL I'm using: model_name.objects.all().values() to return dictionary,…
Maria
  • 59
  • 10
2
votes
1 answer

How to convert cqlengine resultset objects into JSON format

I am writing an API which queries a Cassandra 2.1.2 based database and returns results in JSON format. I am using cqlengine for this. Here is the simplified schema - class Checkins(Model): Model.__comment__ = "Table mapping for submit…
Arovit
  • 3,579
  • 5
  • 20
  • 24
2
votes
1 answer

Updates in CQL-engine

I use Cassandra with Django via cqlengine. Let's assume I have a model like this: class ExampleModel(Model): example_id = columns.UUID(primary_key=True, default=uuid.uuid4) example_types = columns.List(columns.Integer) …
k_wisniewski
  • 2,439
  • 3
  • 24
  • 31
1
vote
0 answers

Aggregate query in Cassandra cqlengine python driver

We have a requirement to keep counters for a specific process. Backend is in Cassandra. We are using python as backend and cqlengine drivers to communicate with cassandra. Table is defined as: class LogCountRecord(db.model): __keyspace__ =…
1
vote
1 answer

varchar column type in cassandra cqlengine

How to define a varchar field in django cassandra model. from cassandra.cqlengine import columns from django_cassandra_engine.models import DjangoCassandraModel class ChatEvent(DjangoCassandraModel): interview_id =…
aryan
  • 133
  • 2
  • 8
1
vote
1 answer

Cqlengine in python does not insert values in new fields after schema change (Cassandra)

I'm trying to insert rows into a table after changing its schema in Cassandra with the CQLEngine python library. Before the change, the model looked like: class MetricsByDevice(Model): device = columns.Text(primary_key=True, partition_key=True) …
ainsausti
  • 705
  • 1
  • 7
  • 25
1
vote
0 answers

ModelDefinitionException("At least 1 primary key is required.") even when Primary key is already defined

I am using Cqlalchemy to interact with Cassandra db using Python. While running the application, I am facing error raise ModelDefinitionException("At least 1 primary key is required.") cassandra.cqlengine.models.ModelDefinitionException: At least 1…
Avik Aggarwal
  • 599
  • 7
  • 28
1
vote
2 answers

Django migration raised TypeError: Unknown option(s) for sync_cassandra command

I trying to use Cassandra database for my Django rest application. When I am using SQLite database the migration working fine. However, when I am changing the database to use cassandra I am getting the following error. TypeError: Unknown option(s)…
saikat
  • 145
  • 1
  • 14
1
vote
1 answer

How to dynamically define CQLEngine models?

I am using Datastax's Cassandra Python driver's Object Mapper for defining cassandra table columns. I am trying to define the models at run time (that's the requirement). The table and column names and column types are resolved at run time. I am…
hemant
  • 23
  • 7
1
vote
1 answer

Cassandra CQLEngine Allow Filtering

I'm using Python Cassandra Cqlengine extension. I create many-to-many table but I receive error in user_applications model query filtering process. I'm readed different resource for this problem, but I did not fully understand this problem.…
rootturk
  • 316
  • 4
  • 20
1
vote
1 answer

udt in cassandra cqlengine Django, updates the latest entry while trying to create a new entry

I am trying to create a new entry in Cassandra database using cqlengine, the first post creates a new entry, but when trying to create another entry, the last item gets updated with new values, after restarting the Django server, it works as…
1
vote
2 answers

Cassandra: occasional permission errors

I use cqlengine with django. In some occasions Cassandra throws an error indicating that user has no permissions do to something. Sometimes this is select, sometimes this is update or sometimes it is something else. I have no code to share, because…
Ege Aydın
  • 1,041
  • 1
  • 13
  • 27
1
vote
0 answers

cassandra cqlengine batch update if exists

I am a newbie to the world of cassandra. I am trying to find the right api in cassandra cqlengine, which I can use to update a record only if one exists previously. The examples that I have come across do not tackle this particular case and my brute…
user1855193
  • 123
  • 3
  • 10
1
vote
1 answer

Testing the service with Cassandra ORM models

I've got the service that uses Cassandra models to store some data, I create custom connection and so on, but I do not use it explicitly, as I use ORM provided by cqlengine, it implicitly creates sessions and executes queries. The question is about…
Sindbag
  • 331
  • 3
  • 15