Comments (4)
You mean this?:
-- name: OrderAuthorsById :many
SELECT * FROM authors
ORDER BY id
LIMIT $1;
from sqlc.
yes. especially, for ORDER clause. for limit, maybe it is engine dependent can 't remember for sure.
from sqlc.
Well I don't think this problem is within the scope of this package. This thread on the Postgres mailing list has some details on the matter.
It appears that prepared statements receive values, while the ORDER clause receives identifiers. So apparently, it is not possible to have dynamic values for the ORDER clause.
from sqlc.
@euller88 is correct. sqlc supports parameterized limits, but can not support parameterized ordering.
from sqlc.
Related Issues (20)
- incorrect field type generated for nullable column HOT 1
- Incorrect SUM() type inference (missing NULL possibility) HOT 2
- Edge case in model name of generated code HOT 1
- Embedded table columns `optional` HOT 1
- sqlc.embed does not work with VIEWs when a schema is provided
- Named parameters for MySQL inserts / updates HOT 2
- Support zeronull.Text in addition to pgtype.Text in pgx mode HOT 1
- WithTx(tx *sql.Tx) should accept an interface instead HOT 1
- Query Specific Type Overrides HOT 1
- DDL language recognition to allow idempotent type creation HOT 4
- Query and column overrides use different types for the same underlying database type HOT 1
- sqlc.slice(): Generate code with unused imports HOT 1
- Use interfaces as query inputs instead of structs
- Select from views and `array_agg` HOT 2
- sqlc.arg error. geometric_type ?# geometric_type → boolean
- jsonb query error with jsonb_array_elements WITH ORDINALITY
- Duplication of fields when generating for pgx/v5
- Type Inference Problem for Array Comparisons in SQL Queries HOT 1
- Migrate to github.com/antlr4-go/antlr/v4
- Using `where x = $1::TEXT[]` breaks type checking HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlc.