Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7492

Dereferencing foreign keys / automating joins

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Fix
    • N/A
    • Parser
    • None

    Description

      Suppose you've got a posts table with a uid foreign key into the users table.
      Wouldn't it be nice if you could say
      select *, uid->name, uid->avatar from posts
      instead of
      select p.*, u.name, u.avatar from posts p left join users u using (uid) ?

      It'd save typing a lot of joins and significantly simplifies writing and reading queries.

      Note the syntax isn't the important part, I simply used the C way of dereferencing a pointer.

      Attachments

        Activity

          People

            jplindst Jan Lindström (Inactive)
            XTF Olaf van der Spek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.