Coder Social home page Coder Social logo

Comments (2)

siddontang avatar siddontang commented on May 30, 2024

@eLco

Could you give me your table scheme and some test data? Like how to insert, update?

from go-mysql.

eLco avatar eLco commented on May 30, 2024

@siddontang the scheme is like this:

CREATE TABLE `testtable` (
  `id` bigint(11) NOT NULL AUTO_INCREMENT,
  `tag` varchar(100) COLLATE utf8mb4_unicode_520_ci NOT NULL,
  `userid` bigint(11) NOT NULL,
  `location` point NOT NULL,
  `disabled` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `testtable_tag_idx1` (`tag`),
  KEY `testtable_userid_idx1` (`userid`)
) ENGINE=InnoDB AUTO_INCREMENT=120032 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci

Example of insert query:

insert into `testtable` (`tag`, `userid`, `location`) values (?,?, point(?,?))
insert into `testtable` (`tag`, `userid`, `location`) values ('party',220, point(12.0563965,55.712296))
insert into `testtable` (`tag`, `userid`, `location`) values ('fashion',221, point(30.738602,46.463898))
insert into `testtable` (`tag`, `userid`, `location`) values ('pop',422, point(35.933304,31.949997))

Example of update query:

update `testtable` set `location` = point(?,?) where userid=?
update `testtable` set `location` = point(11.339798,46.490707) where userid=134
update `testtable` set `location` = point(9.251099,45.404694) where userid=135

hope this helps.

from go-mysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.