joinmark

package
v0.0.1-0...-4535bed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: PostgreSQL Imports: 6 Imported by: 0

Documentation

Overview

Package joinmark converts Oracle JOIN mark

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule struct{}

func (Rule) Match

func (Rule) Match(n ast.Node) bool

func (Rule) Rewrite

func (r Rule) Rewrite(node ast.Node) (ast.Node, error)

Rewrite replaces join mark with OUTER JOIN.

Since [rewrite.Engine] uses depth-first walk, all sub-queries are already translated. This rule can safely recurse to handle all join marks in the tree.

The rule is not perfect and may fail to rewrite some queries. It will fail if:

  • the SELECT * order is changed.
  • a column in WHERE is not prefixed by a table.
  • the rule loses table in FROM clause. (it's a bug)
  • the rule loses condition in WHERE and JOIN. (also a bug)

func (Rule) String

func (Rule) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL