
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
nest-cassandra
Advanced tools
A progressive Node.js framework for building efficient and scalable server-side applications.
Cassandra utilities module for NestJs.
$ npm install nest-cassandra
import { CassandraModule } from 'nest-cassandra'
import { auth } from 'cassandra-driver'
@Module({
imports: [
CassandraModule.forRoot({
keyspace: 'test',
contactPoints: ['127.0.0.1:9042'],
localDataCenter: 'datacenter1',
authProvider: new auth.PlainTextAuthProvider('user', 'pass');
})
],
providers: [...]
})
export class AppModule {}
import { CassandraModel } from 'nest-cassandra'
import { types } from 'cassandra-driver'
export class LookupByHash extends CassandraModel {
@CassandraPartitioningKey()
@CassandraColumn(types.dataTypes.blob)
@CassandraTransforms({
fromJSON: hexStringToBlob,
fromCassandra: hexBlobToString,
})
hash: string;
@CassandraClusteringKey()
@CassandraColumn(types.dataTypes.blob)
archive: string;
@CassandraColumn(types.dataTypes.timestamp)
timestamp: Date;
}
import { Injectable } from '@nestjs/common';
import { CassandraRepository } from 'nest-cassandra'
export class LookupByHashRepository extends CassandraRepository<LookupByHash> {
tableName = 'lookup_by_hash';
modelName = 'LookupByHash';
model = new LookupByHash();
}
@Injectable()
export class LookupByHashService {
constructor(
private readonly boundWitnessesByHashRepository: LookupByHashRepository,
) {}
findByHash(hash: string) {
return this.boundWitnessesByHashRepository.findOne({ hash });
}
page({ limit, cursor, ...query }) {
return this.boundWitnessesByArchiveRepository.page(query, {
limit,
cursor,
});
}
}
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
Nest is MIT licensed.
FAQs
Cassandra utilities module for NestJs.
The npm package nest-cassandra receives a total of 0 weekly downloads. As such, nest-cassandra popularity was classified as not popular.
We found that nest-cassandra demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.