-
-
Notifications
You must be signed in to change notification settings - Fork 628
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
Bulk insert with POINT #234
Comments
could you post full simple example ( with schema creation ) so I can try to reproduce and suggest solution? |
Server version: Schema: /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for test
CREATE DATABASE IF NOT EXISTS `test` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `test`;
-- Dumping structure for table test.coordinates
CREATE TABLE IF NOT EXISTS `coordinates` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`location` point NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Data exporting was unselected.
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; Node.js: var mysql = require('mysql2');
var connection = mysql.createConnection({
"host": "localhost",
"user": "me",
"password": "secret",
"database": "test"
});
var values = [
[{x: 1, y: 4}],
[{x: 23, y: -8.345}]
];
connection.connect();
var q = connection.query('INSERT INTO coordinates (location) ?', [values], function (err) {
if (err) {
throw err;
}
});
console.log("SQL:", q.sql);
connection.end(); Output:
|
yes, it's currently not supported by this library ( and by node-mysql ) |
Thanks for clarification. |
@sidorares Any fix for this issue ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can I use bulk insert with POINT?
I use http://stackoverflow.com/a/25086900/5607875 like example. It doesn't work.
The text was updated successfully, but these errors were encountered: