希望Select方法能支持插值 #2327

Open
opened 2023-08-30 06:13:03 +00:00 by cos800 · 1 comment

我要查询的SQL大概是这样

SELECT`id`, `title`, ST_Distance_Sphere(POINT(`pos_lng`, `pos_lat`), POINT(?, ?)) as `dist` FROM `table_name`

两个问号,分别要替换成经度和纬度,

但是XORMSelect方法并不支持插值。

image

我要查询的`SQL`大概是这样 ```sql SELECT`id`, `title`, ST_Distance_Sphere(POINT(`pos_lng`, `pos_lat`), POINT(?, ?)) as `dist` FROM `table_name` ``` **两个问号,分别要替换成经度和纬度,** 但是`XORM`的`Select`方法并不支持插值。 ![image](/attachments/4071e3f5-8cc9-40e8-b7ed-b7a3877db8d0)
lunny added the
kind
proposal
label 2023-08-31 16:00:19 +00:00
Member

不一定可以,得看底层驱动支不支持 select 中占用占位符

不一定可以,得看底层驱动支不支持 select 中占用占位符
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#2327
No description provided.