![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
great-scott
Advanced tools
Postgres data source library
Optional properties
model
- A Immutable Data Record (see https://www.npmjs.com/package/immutable).connectionString
- A Postgres connection string.tableName
- (required for insert/update helpers) the name of the table to extract data fromidAttribute
- (optional) the primary key attribute
import { DataSource } from 'great-scott';
import Avery from 'avery';
var UserModel = Avery.Model({
name : 'User',
defaults : {
id : null,
name : null,
}
});
class UserDataSource extends DataSource {
constructor() {
super({
tableName : 'users',
model : UserModel,
connectionString : process.env.POSTGRES_URL,
});
}
// object to model with camel case keys
parse(row) {
return new this.model(_.transform(row, function(memo, val, key) {
memo[ _.camelCase(key) ] = val;
return memo;
}));
}
// model to object with snake case keys
format(model) {
var row = model.toObject();
return _.transform(row, function(memo, val, key) {
memo[ _.snakeCase(key) ] = val;
return memo;
});
}
findAll : function() {
var query = this.builder
.select()
.from('users');
return this.execute(query);
}
createUser(userModel) {
return this.insert(userMode);
}
}
UserDataSource.createUser(myUser)
.then(function(results) {
console.log('success', results);
});
UserDataSource.findAllUsers()
.then(function(results) {
console.log('success', results);
});
FAQs
A Marty-like data source for postgres.
The npm package great-scott receives a total of 1 weekly downloads. As such, great-scott popularity was classified as not popular.
We found that great-scott demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.