Skip to content
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

Molecular mysql DB mixing Sample #283

Open
sachinda123456 opened this issue Sep 10, 2021 · 0 comments
Open

Molecular mysql DB mixing Sample #283

sachinda123456 opened this issue Sep 10, 2021 · 0 comments

Comments

@sachinda123456
Copy link

sachinda123456 commented Sep 10, 2021

Hi i need sample DB mixing for MySQL . I have develop some working mixing file . But when i used docker compose up it say MySQL data not connected . and also i make some console log . When i open logs in relevant container It does not seen any console log . it show going to connect some local db and get fail .

module.exports = function (collection) {

console.log('process.env.MYSQL_INVOICE_DB_HOS ****<<>>>',process.env.MYSQL_INVOICE_DB_HOS)

if (process.env.MYSQL_INVOICE_DB_HOST) {
	schema.adapter = new SqlAdapter(
		process.env.MYSQL_INVOICE_DB,
		process.env.MYSQL_INVOICE_DB_USER,
		process.env.MYSQL_INVOICE_DB_PASS,
		{
			host: process.env.MYSQL_INVOICE_DB_HOST,
			dialect: "mysql",
			pool: {
				max: 5,
				min: 0,
				idle: 10000,
			},
		}
	);
	schema.collection = collection;

} else if (process.env.NODE_ENV === "test") {
	schema.adapter = new DbService.MemoryAdapter();
} else {
	schema.adapter = new SqlAdapter("invoice", "root", "admin", {
		host: "localhost",
		dialect: "mysql",
		pool: {
			max: 5,
			min: 0,
			idle: 10000,
		},
	});
	schema.collection = collection;
}
return schema;

};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant