-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use h2 in Nodejs #1
Comments
Hello MOST Data H2 Adapter (@themost/h2) is one of the available adapters of @themost/data which of MOST Web Framework You can use @themost/cli tool in order to create a new data project (you can read more about this in the previous link) @themost/data is a fully configuration ORM with several features that helps developers to build scalable applications. Now @themost/data is in version 2.x focused on ES7 and Typescript. You can read more about MOST Data Module features in the previous version of most-data. @themost/data is an ORM based on configurable data schemas. So first of all you need to create a basic application structure:
config/models/Person.json schema holds Person schema e.g.
config/models/app.json is the application configuration file. This file contains data adapters configuration and othe configuration settings. The following configuration file holds information about a local H2 database:
Install core modules:
and create a test script which is equivalent with your script:
Of course the previous example is a basic test script. If you want to create a data application based on @themost/data ORM please read the instructions provided in: MOST Web Framework (v2.x) MOST Data ORM Module (v 1.x): I hope these instructions will help you to start using @themost/data ORM and its powerful features. |
Hi, I want to know how I call the functions that you've made, in the case when I use MongoDb I do something like this:
`var mongoose = require('mongoose');
mongoose.connect('mongodb://user:passwordDB@ds253821.mlab.com:53821/addressbook')
var Schema = mongoose.Schema;
var personSchema = new Schema({
firstname: String,
lastname: String,
addres: String
});
var Person = mongoose.model('Person',personSchema);
var john = Person({
firstname: 'Damaso',
lastname: 'Fernandez',
addres: '55 Main st.'
});
john.save((err) => {
if(err) throw err;
console.log('Person Saved!!');
});`
could you please guide me how can I do something like this with the code that you made,
Thank you in advance for your answer.
The text was updated successfully, but these errors were encountered: