Skip to content

Commit 1db192b

Browse files
Merge pull request #3 from readysettech/query_hints_pg
PostgreSQL: Parse optimizer hints in leading comments
2 parents 9f04ebe + 9702c88 commit 1db192b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/dialect/postgresql.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
stacker = "0.1"
12
// Licensed to the Apache Software Foundation (ASF) under one
23
// or more contributor license agreements. See the NOTICE file
34
// distributed with this work for additional information
@@ -318,4 +319,12 @@ impl Dialect for PostgreSqlDialect {
318319
fn supports_xml_expressions(&self) -> bool {
319320
true
320321
}
322+
323+
/// Postgres supports query optimizer hints via the `pg_hint_plan` extension,
324+
/// using the same comment-prefixed-with-`+` syntax as MySQL and Oracle.
325+
///
326+
/// See <https://github.com/ossc-db/pg_hint_plan>
327+
fn supports_comment_optimizer_hint(&self) -> bool {
328+
true
329+
}
321330
}

0 commit comments

Comments
 (0)