Soap Mysql
MySql for SoapJS This page and the plugin itself are still in development, a lot will change.
Features
Installation
npm install @soapjs/soap-node-mysqlUsage
import { MySqlCollection, MySqlConfig, MySqlQueryFactory, MySqlSource, } from '@soapjs/soap-node-mysql';const config = new MySqlConfig({ database: 'yourDatabase', hosts: ['localhost'], ports: ['27017'], user: 'yourUser', password: 'yourPassword' // additional config parameters });const mysqlSource = await MySqlSource.create(config);const queryFactory = new MySqlQueryFactory(); const params = FindParams.create({ where: new Where().valueOf('customer').isEq(userId) }); const queryParts = queryFactory.createFindQuery(params);const collection = new MySqlCollection<MyDocumentType>(mysqlSource, 'myCollectionName'); const documents = await collection.find(queryParts); /* // You can also use a raw SQL query as a string. Then remember to validate this query beforehand const documents = await collection.find(`SELECT * FROM ${collection.collectionName} ...`); */
Last updated