Ha a dockeres iranyt valasztod, akkor egy mini-tutorial;)
Kiprobalod, hogy fut-e az mssql:
$ mkdir mssql-lol
$ cd mssql-lol
$ npm install sql-cli
$ node_modules/.bin/mssql -u sa -p Csaknemtorikm3g
Connecting to localhost...done
sql-cli version 0.4.13
Enter ".help" for usage hints.
mssql> .quit
Letrehozol egy adatbazist:
$ node_modules/.bin/mssql -u sa -p Csaknemtorikm3g -q "CREATE DATABASE SampleDB;"
OK
Executed in 0 ms
Es letrehozol egy egyszeru kis mini projektet:
$ npm init -y
$ npm install --save tedious
$ npm install --save async
$ cat connect.js
var Connection = require('tedious').Connection;
var Request = require('tedious').Request;
var TYPES = require('tedious').TYPES;
// Create connection to database
var config = {
userName: 'sa', // update me
password: 'Csaknemtorikm3g', // update me
server: 'localhost',
options: {
database: 'SampleDB'
}
}
var connection = new Connection(config);
// Attempt to connect and execute queries if connection goes through
connection.on('connect', function(err) {
if (err) {
console.log(err);
} else {
console.log('Connected');
}
});
Es kiprobalod, hogy megy-e:
$ node connect.js
Connected
Innen mar csak par honap es portoltad is az eredeti alkalmazast.
Remelem van benne par stored procedure.... :)
A fenti kodot (bar kiprobaltam, tenyleg megy), nem en talaltam ki, innen vettem:
https://www.microsoft.com/en-us/sql-server/
Es, hogy teljes legyen a kep, itt az EULA:
go.microsoft.com/fwlink/?LinkId=746388 (20170114, sha1: b000a4ff0311587235ad815fe87024ef499862d4)
Es ha mar itt EULA-skodunk:
- nem hasznalhatod live environment-ben, szerintem ez alatt a production kornyezetet erti.
- 120 nap utan kill switch van beepitve (error.log-ban 150 napot emlit a program).
- hazaszol a ms-nek, a gep adataival egyutt. Nehany reszt ezutan tilt(hat), barmikor.
--> valoszinu erdemes szeparalt halozatban futtatni.
Igazabol jogilag ez se hasznalhato, ez az egy mondat miatt:
"""You may not test the software in a live operating environment unless
Microsoft permits you to do so under another agreement."""
A tobbit technikailag meg lehetne kerulni:)
---
Saying a programming language is good because it works on all platforms is like saying anal sex is good because it works on all genders....