Full Code of xo/usql for AI

master 0775ee420350 cached
268 files
1.1 MB
402.3k tokens
901 symbols
1 requests
Download .txt
Showing preview only (1,218K chars total). Download the full file or copy to clipboard to get everything.
Repository: xo/usql
Branch: master
Commit: 0775ee420350
Files: 268
Total size: 1.1 MB

Directory structure:
gitextract_wko_uh41/

├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       ├── announce.yml
│       ├── release.yml
│       └── test.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── build.sh
├── contrib/
│   ├── adodb/
│   │   ├── adodb.sh
│   │   └── usql-config
│   ├── cassandra/
│   │   ├── podman-config
│   │   ├── test.sql
│   │   └── usql-config
│   ├── charts/
│   │   ├── area_density_stacked.vl.json
│   │   └── penguins.json
│   ├── clickhouse/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── cockroach/
│   │   └── podman-config
│   ├── config.yaml
│   ├── couchbase/
│   │   ├── README.md
│   │   ├── podman-config
│   │   └── usql-config
│   ├── db2/
│   │   ├── README.md
│   │   ├── db2cli-validate.sh
│   │   ├── db2dsdriver.cfg
│   │   ├── install-dsdriver.sh
│   │   ├── podman-config
│   │   ├── test.sql
│   │   └── usql-config
│   ├── duckdb/
│   │   └── usql-config
│   ├── exasol/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── firebird/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── flightsql/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── go-setup.sh
│   ├── godror/
│   │   ├── fix-oob-config.sh
│   │   ├── grab-instantclient.sh
│   │   └── usql-config
│   ├── h2/
│   │   └── podman-config
│   ├── hive/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── ignite/
│   │   ├── README.md
│   │   ├── activate.sh
│   │   ├── podman-config
│   │   └── usql-config
│   ├── mymysql/
│   │   └── usql-config
│   ├── mysql/
│   │   ├── podman-config
│   │   ├── test.sql
│   │   └── usql-config
│   ├── oracle/
│   │   ├── init.sql
│   │   ├── podman-config
│   │   └── usql-config
│   ├── oracle-enterprise/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── pgx/
│   │   └── usql-config
│   ├── podman-run.sh
│   ├── podman-stop.sh
│   ├── postgres/
│   │   ├── init.sql
│   │   ├── podman-config
│   │   ├── schema.sql
│   │   ├── test.sql
│   │   └── usql-config
│   ├── presto/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── sqlite3/
│   │   ├── build-windows-icu.sh
│   │   ├── icu-i18n-mingw64.pc
│   │   ├── test.sql
│   │   └── usql-config
│   ├── sqlserver/
│   │   ├── init.sql
│   │   ├── podman-config
│   │   ├── test.sql
│   │   └── usql-config
│   ├── trino/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── usql-test.sh
│   ├── usqlpass
│   ├── usqlrc
│   ├── vertica/
│   │   ├── podman-config
│   │   └── usql-config
│   └── ydb/
│       ├── podman-config
│       └── usql-config
├── drivers/
│   ├── adodb/
│   │   └── adodb.go
│   ├── athena/
│   │   └── athena.go
│   ├── avatica/
│   │   └── avatica.go
│   ├── bigquery/
│   │   └── bigquery.go
│   ├── cassandra/
│   │   └── cassandra.go
│   ├── chai/
│   │   └── chai.go
│   ├── clickhouse/
│   │   ├── clickhouse.go
│   │   ├── clickhouse_test.go
│   │   ├── reader.go
│   │   └── testdata/
│   │       └── clickhouse.sql
│   ├── completer/
│   │   ├── completer.go
│   │   └── completer_test.go
│   ├── cosmos/
│   │   └── cosmos.go
│   ├── couchbase/
│   │   └── couchbase.go
│   ├── csvq/
│   │   └── csvq.go
│   ├── databend/
│   │   └── databend.go
│   ├── databricks/
│   │   └── databricks.go
│   ├── drivers.go
│   ├── drivers_test.go
│   ├── duckdb/
│   │   └── duckdb.go
│   ├── dynamodb/
│   │   └── dynamodb.go
│   ├── errors.go
│   ├── exasol/
│   │   └── exasol.go
│   ├── firebird/
│   │   └── firebird.go
│   ├── flightsql/
│   │   └── flightsql.go
│   ├── godror/
│   │   └── godror.go
│   ├── h2/
│   │   └── h2.go
│   ├── hive/
│   │   └── hive.go
│   ├── ignite/
│   │   └── ignite.go
│   ├── impala/
│   │   └── impala.go
│   ├── maxcompute/
│   │   └── maxcompute.go
│   ├── metadata/
│   │   ├── impala/
│   │   │   └── metadata.go
│   │   ├── informationschema/
│   │   │   ├── metadata.go
│   │   │   └── metadata_test.go
│   │   ├── metadata.go
│   │   ├── metadata_test.go
│   │   ├── mysql/
│   │   │   └── metadata.go
│   │   ├── oracle/
│   │   │   └── metadata.go
│   │   ├── postgres/
│   │   │   ├── metadata.go
│   │   │   └── metadata_test.go
│   │   ├── reader.go
│   │   └── writer.go
│   ├── moderncsqlite/
│   │   └── moderncsqlite.go
│   ├── mymysql/
│   │   └── mymysql.go
│   ├── mysql/
│   │   └── mysql.go
│   ├── netezza/
│   │   └── netezza.go
│   ├── odbc/
│   │   └── odbc.go
│   ├── oracle/
│   │   ├── oracle.go
│   │   └── orshared/
│   │       └── orshared.go
│   ├── ots/
│   │   └── ots.go
│   ├── pgx/
│   │   └── pgx.go
│   ├── postgres/
│   │   └── postgres.go
│   ├── presto/
│   │   └── presto.go
│   ├── ql/
│   │   └── ql.go
│   ├── qtype.go
│   ├── ramsql/
│   │   └── ramsql.go
│   ├── sapase/
│   │   └── sapase.go
│   ├── saphana/
│   │   └── saphana.go
│   ├── snowflake/
│   │   └── snowflake.go
│   ├── spanner/
│   │   └── spanner.go
│   ├── sqlite3/
│   │   ├── sqlite3.go
│   │   └── sqshared/
│   │       ├── reader.go
│   │       ├── reader_test.go
│   │       └── sqshared.go
│   ├── sqlserver/
│   │   ├── reader.go
│   │   ├── sqlserver.go
│   │   └── sqlserver_test.go
│   ├── testdata/
│   │   ├── .gitignore
│   │   ├── csvq/
│   │   │   └── .gitignore
│   │   ├── docker/
│   │   │   └── Dockerfile
│   │   ├── gen-golden.sh
│   │   ├── mysql.descTable.expected.txt
│   │   ├── mysql.descTable.golden.txt
│   │   ├── mysql.listFuncs.expected.txt
│   │   ├── mysql.listIndexes.expected.txt
│   │   ├── mysql.listSchemas.expected.txt
│   │   ├── mysql.listSchemas.golden.txt
│   │   ├── mysql.listTables.expected.txt
│   │   ├── mysql.listTables.golden.txt
│   │   ├── pgsql.descTable.expected.txt
│   │   ├── pgsql.descTable.golden.txt
│   │   ├── pgsql.listDbs.golden.txt
│   │   ├── pgsql.listFuncs.expected.txt
│   │   ├── pgsql.listFuncs.golden.txt
│   │   ├── pgsql.listIndexes.expected.txt
│   │   ├── pgsql.listIndexes.golden.txt
│   │   ├── pgsql.listSchemas.expected.txt
│   │   ├── pgsql.listSchemas.golden.txt
│   │   ├── pgsql.listTables.expected.txt
│   │   ├── pgsql.listTables.golden.txt
│   │   ├── sqlserver.descTable.expected.txt
│   │   ├── sqlserver.listFuncs.expected.txt
│   │   ├── sqlserver.listIndexes.expected.txt
│   │   ├── sqlserver.listSchemas.expected.txt
│   │   ├── sqlserver.listTables.expected.txt
│   │   ├── trino.descTable.expected.txt
│   │   ├── trino.listSchemas.expected.txt
│   │   └── trino.listTables.expected.txt
│   ├── trino/
│   │   ├── reader.go
│   │   └── trino.go
│   ├── vertica/
│   │   └── vertica.go
│   ├── voltdb/
│   │   └── voltdb.go
│   └── ydb/
│       └── ydb.go
├── env/
│   ├── env.go
│   ├── list.go
│   └── vars.go
├── gen.go
├── go.mod
├── go.sum
├── handler/
│   └── handler.go
├── internal/
│   ├── adodb.go
│   ├── athena.go
│   ├── avatica.go
│   ├── bigquery.go
│   ├── cassandra.go
│   ├── chai.go
│   ├── clickhouse.go
│   ├── cosmos.go
│   ├── couchbase.go
│   ├── csvq.go
│   ├── databend.go
│   ├── databricks.go
│   ├── duckdb.go
│   ├── dynamodb.go
│   ├── exasol.go
│   ├── firebird.go
│   ├── flightsql.go
│   ├── godror.go
│   ├── h2.go
│   ├── hive.go
│   ├── ignite.go
│   ├── impala.go
│   ├── internal.go
│   ├── maxcompute.go
│   ├── moderncsqlite.go
│   ├── mymysql.go
│   ├── mysql.go
│   ├── netezza.go
│   ├── odbc.go
│   ├── oracle.go
│   ├── ots.go
│   ├── pgx.go
│   ├── postgres.go
│   ├── presto.go
│   ├── ql.go
│   ├── ramsql.go
│   ├── sapase.go
│   ├── saphana.go
│   ├── snowflake.go
│   ├── spanner.go
│   ├── sqlite3.go
│   ├── sqlserver.go
│   ├── trino.go
│   ├── vertica.go
│   ├── voltdb.go
│   ├── ydb.go
│   └── z.go
├── main.go
├── main_test.go
├── metacmd/
│   ├── charts/
│   │   └── charts.go
│   ├── cmds.go
│   ├── descs.go
│   └── metacmd.go
├── rline/
│   └── rline.go
├── run.go
├── stmt/
│   ├── params.go
│   ├── params_test.go
│   ├── parse.go
│   ├── parse_test.go
│   ├── stmt.go
│   └── stmt_test.go
├── styles/
│   └── styles.go
├── testcli.go
├── testdata/
│   ├── copy.sql
│   ├── inc_test.sql
│   ├── inc_test_z.sql
│   ├── numbers.sql
│   ├── quotes.sql
│   └── sub/
│       ├── inc_test2.sql
│       └── inc_test_z.sql
├── text/
│   ├── errors.go
│   ├── license.go
│   └── text.go
└── update-deps.sh

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      # Check for updates to GitHub Actions every weekday
      interval: "daily"


================================================
FILE: .github/workflows/announce.yml
================================================
name: Announce Release
on:
  release:
    types: [published]
env:
  VER: ${{ github.ref_name }}
  AUTHOR_NAME: Kenneth Shaw
  AUTHOR_EMAIL: kenshaw@gmail.com
  HOMEBREW_REPO: https://kenshaw:${{ secrets.HOMEBREW_TOKEN }}@github.com/xo/homebrew-xo.git

# cribbed from https://github.com/actions/runner/issues/691
jobs:
  configure:
    name: Configure
    runs-on: ubuntu-latest
    outputs:
      username: ${{ steps.get-user.outputs.username }}
    steps:
      - id: get-user
        name: Get User
        run: echo "username=$(id -n -u)" >> $GITHUB_OUTPUT

  bump-aur-package:
    name: Bump AUR Package
    runs-on: ubuntu-latest
    needs: configure
    container:
      image: docker.io/library/archlinux:latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - package: usql
            repo: aur@aur.archlinux.org:usql.git
          - package: usql-bin
            repo: aur@aur.archlinux.org:usql-bin.git

    steps:
      - name: Setup
        run: |
          export USERNAME=${{ needs.configure.outputs.username }}
          pacman-key --init
          pacman -Sy --noconfirm archlinux-keyring
          pacman -Sy --noconfirm git base-devel sudo pacman-contrib devtools
          useradd -m $USERNAME
          echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

      - name: Add AUR SSH key
        uses: shimataro/ssh-key-action@v2
        with:
          key: ${{ secrets.AUR_SSH_KEY }}
          name: id_ed25519
          known_hosts: |
            aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN
            aur.archlinux.org ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDKF9vAFWdgm9Bi8uc+tYRBmXASBb5cB5iZsB7LOWWFeBrLp3r14w0/9S2vozjgqY5sJLDPONWoTTaVTbhe3vwO8CBKZTEt1AcWxuXNlRnk9FliR1/eNB9uz/7y1R0+c1Md+P98AJJSJWKN12nqIDIhjl2S1vOUvm7FNY43fU2knIhEbHybhwWeg+0wxpKwcAd/JeL5i92Uv03MYftOToUijd1pqyVFdJvQFhqD4v3M157jxS5FTOBrccAEjT+zYmFyD8WvKUa9vUclRddNllmBJdy4NyLB8SvVZULUPrP3QOlmzemeKracTlVOUG1wsDbxknF1BwSCU7CmU6UFP90kpWIyz66bP0bl67QAvlIc52Yix7pKJPbw85+zykvnfl2mdROsaT8p8R9nwCdFsBc9IiD0NhPEHcyHRwB8fokXTajk2QnGhL+zP5KnkmXnyQYOCUYo3EKMXIlVOVbPDgRYYT/XqvBuzq5S9rrU70KoI/S5lDnFfx/+lPLdtcnnEPk=
            aur.archlinux.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLMiLrP8pVi5BFX2i3vepSUnpedeiewE5XptnUnau+ZoeUOPkpoCgZZuYfpaIQfhhJJI5qgnjJmr4hyJbe/zxow=

      - name: Bump AUR Package (${{ matrix.package }})
        run: |
          export USERNAME=${{ needs.configure.outputs.username }}
          export PACKAGE=${{ matrix.package }}
          export REPO=${{ matrix.repo }}
          export WORKDIR=$(mktemp -d /tmp/${PACKAGE}.XXXXXX)
          export REPO_PATH=$WORKDIR/${PACKAGE}
          export CHANGELOG=$(
            curl \
              -s \
              -H 'Accept: application/vnd.github+json' \
              https://api.github.com/repos/xo/usql/releases/tags/$VER \
              |jq -r .body \
              |sed -e 's/\\r//g' -e 's/\[VirusTotal.*//'
          )
          git clone $REPO $REPO_PATH
          git config --global --add safe.directory $REPO_PATH
          git -C $REPO_PATH config user.name "$AUTHOR_NAME"
          git -C $REPO_PATH config user.email "$AUTHOR_EMAIL"
          sed -i "s/pkgver=.*$/pkgver=${VER#v}/" $REPO_PATH/PKGBUILD
          sed -i "s/sha256sums\\([^=]*\\)=.*$/sha256sums\\1=('SKIP')/" $REPO_PATH/PKGBUILD
          sed -i "s/pkgrel=.*$/pkgrel=1/" $REPO_PATH/PKGBUILD
          chown -R ${USERNAME}:${USERNAME} $WORKDIR
          pushd $REPO_PATH &> /dev/null
          sudo -u ${USERNAME} bash -c 'updpkgsums'
          sudo -u ${USERNAME} bash -c 'makepkg --printsrcinfo > .SRCINFO'
          popd &> /dev/null
          git -C $REPO_PATH add PKGBUILD .SRCINFO
          git -C $REPO_PATH commit -m "$(printf %b "Update usql version to ${VER}\n\n${CHANGELOG}")"
          git -C $REPO_PATH show -C
          git -C $REPO_PATH push origin master

  bump-homebrew-formula:
    name: Bump Homebrew Formula
    runs-on: ubuntu-latest
    steps:
      - name: Bump Homebrew Formula
        run: |
          export WORKDIR=$(mktemp -d /tmp/homebrew-xo.XXXXXX)
          export REPO_PATH=$WORKDIR/homebrew-xo
          wget -O $WORKDIR/archive.tar.gz https://github.com/xo/usql/archive/${VER}.tar.gz
          export SHA256SUM=$(sha256sum $WORKDIR/archive.tar.gz|awk '{print $1}')
          export CHANGELOG=$(
            curl \
              -s \
              -H 'Accept: application/vnd.github+json' \
              https://api.github.com/repos/xo/usql/releases/tags/$VER \
              |jq -r .body \
              |sed -e 's/\\r//g' -e 's/\[VirusTotal.*//'
          )
          git clone $HOMEBREW_REPO $REPO_PATH
          git -C $REPO_PATH config user.name "$AUTHOR_NAME"
          git -C $REPO_PATH config user.email "$AUTHOR_EMAIL"
          sed -i "s%url \".*$%url \"https://github.com/xo/usql/archive/${VER}.tar.gz\"%" $REPO_PATH/Formula/usql.rb
          sed -i "s/sha256 \".*$/sha256 \"$SHA256SUM\"/" $REPO_PATH/Formula/usql.rb
          git -C $REPO_PATH add Formula/usql.rb
          git -C $REPO_PATH commit -m "$(printf %b "Update usql version to ${VER}\n\n${CHANGELOG}")"
          git -C $REPO_PATH show -C
          git -C $REPO_PATH push origin master

  announce-discord:
    name: Announce Discord
    runs-on: ubuntu-latest
    steps:
      - name: Announce Discord
        run: |
          curl \
            -H 'Content-Type: application/json' \
            -d '{"username": "usql", "content": "> *usql ${{ github.ref_name }}* has been released!\n\nGet it here: https://github.com/xo/usql/releases/${{ github.ref_name }}"}' \
            ${{ secrets.DISCORD_WEBHOOK_URL }}


================================================
FILE: .github/workflows/release.yml
================================================
name: Release
on: push
env:
  APP: usql
  VER: ${{ github.ref_name }}
  GO_VERSION: stable

jobs:
  build_for_linux:
    name: Build for Linux
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        arch: [amd64, arm, arm64]
    steps:
      - name: Install build dependencies
        run: |
          sudo apt-get -qq update
          sudo apt-get install -y \
            build-essential \
            qemu-user \
            gcc-arm-linux-gnueabihf \
            g++-arm-linux-gnueabihf \
            gcc-aarch64-linux-gnu \
            g++-aarch64-linux-gnu \
            libstdc++6-armhf-cross \
            libstdc++6-arm64-cross \
            libc6-dev-armhf-cross \
            libc6-dev-arm64-cross \
            file
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup Go
        uses: actions/setup-go@v5
        with:
          go-version: ${{ env.GO_VERSION }}
      - name: Build ${{ matrix.arch }}
        run: |
          ./build.sh -v $VER -a ${{ matrix.arch }}
      - name: Build ${{ matrix.arch }} (static)
        if: matrix.arch != 'arm'
        run: |
          ./build.sh -v $VER -a ${{ matrix.arch }} -s
      - name: Archive artifacts
        uses: actions/upload-artifact@v4
        with:
          name: dist-linux-${{ matrix.arch }}
          path: build/linux/**/*
          if-no-files-found: error

  build_for_macos:
    name: Build for macOS
    runs-on: macos-latest
    strategy:
      matrix:
        arch: [amd64, arm64]
    steps:
      - name: Install build dependencies
        run: |
          brew install coreutils
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup Go
        uses: actions/setup-go@v5
        with:
          go-version: ${{ env.GO_VERSION }}
      - name: Build ${{ matrix.arch }}
        run: |
          ./build.sh -v $VER -a ${{ matrix.arch }}
      - name: Archive artifacts
        uses: actions/upload-artifact@v4
        with:
          name: dist-darwin-${{ matrix.arch }}
          path: build/darwin/**/*
          if-no-files-found: error

  build_for_macos_universal:
    name: Build for macOS (universal)
    needs:
      - build_for_macos
    runs-on: macos-latest
    steps:
      - name: Install build dependencies
        run: |
          brew install coreutils
      - name: Download artifacts
        uses: actions/download-artifact@v4
      - name: Build universal
        run: |
          if [ "$VER" = "master" ]; then
            VER=0.0.0-dev
          fi

          export WORKDIR=$PWD/build/darwin/universal/$VER
          mkdir -p $WORKDIR

          gtar -jxvf dist-darwin-amd64/*/*/*.tar.bz2 -C $WORKDIR $APP
          gtar -jxvf dist-darwin-amd64/*/*/*.tar.bz2 -C $WORKDIR LICENSE
          mv $WORKDIR/$APP $WORKDIR/$APP-amd64

          gtar -jxvf dist-darwin-arm64/*/*/*.tar.bz2 -C $WORKDIR $APP
          mv $WORKDIR/$APP $WORKDIR/$APP-arm64

          file $WORKDIR/$APP-{amd64,arm64}

          lipo -create -output $WORKDIR/$APP $WORKDIR/$APP-amd64 $WORKDIR/$APP-arm64
          chmod +x $WORKDIR/$APP
          file $WORKDIR/$APP

          rm $WORKDIR/$APP-{amd64,arm64}

          sudo /usr/sbin/purge

          gtar -C $WORKDIR -cjf $WORKDIR/$APP-${VER#v}-darwin-universal.tar.bz2 $APP LICENSE
          ls -alh $WORKDIR/*
          sha256sum $WORKDIR/*
      - name: Archive artifacts
        uses: actions/upload-artifact@v4
        with:
          name: dist-darwin-universal
          path: build/darwin/**/*
          if-no-files-found: error

  build_for_windows:
    name: Build for Windows
    runs-on: windows-latest
    steps:
      - name: Install build dependencies
        run: choco install zip
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup Go
        uses: actions/setup-go@v5
        with:
          go-version: ${{ env.GO_VERSION }}
      - name: Build amd64
        shell: bash
        run: |
          ./build.sh -v $VER
      - name: Archive artifacts
        uses: actions/upload-artifact@v4
        with:
          name: dist-windows
          path: build/windows/**/*
          if-no-files-found: error

  draft_release:
    name: Draft Release
    needs:
      - build_for_linux
      - build_for_macos
      - build_for_macos_universal
      - build_for_windows
    runs-on: ubuntu-latest
    steps:
      - name: Download artifacts
        uses: actions/download-artifact@v4
      - name: Extract artifacts
        run: |
          mkdir /tmp/scan
          mkdir scan
          for i in $(find dist-* -name \*.tar.bz2); do
            name=$(basename $i|cut -d- -f1)
            ver=$(sed -e 's/\.tar\.bz2$//' <<< $(basename $i)|cut -d- -f2-)
            echo "extracting $i ($name $ver)"
            tar -C /tmp/scan -jv -f $i -x $name
            hash=$(sha256sum /tmp/scan/$name|awk '{print $1}')
            mv /tmp/scan/$name ./scan/$name-$ver-${hash:0:8}
          done
          for i in $(find dist-* -name \*.zip); do
            name=$(basename $i|cut -d- -f1)
            ver=$(sed -e 's/\.zip$//' <<< $(basename $i)|cut -d- -f2-)
            echo "extracting $i ($name $ver)"
            unzip -d /tmp/scan $i $name.exe
            hash=$(sha256sum /tmp/scan/$name.exe|awk '{print $1}')
            mv /tmp/scan/$name.exe ./scan/$name-$ver-${hash:0:8}.exe
          done
          file ./scan/*
          sha256sum ./scan/*
      - name: Submit to VirusTotal
        id: virustotal
        uses: crazy-max/ghaction-virustotal@v4
        with:
          vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
          request_rate: 4
          files: |
            ./scan/*
      - name: Generate Release Notes
        id: generate_release_notes
        uses: softprops/action-gh-release@v2
        if: startsWith(github.ref, 'refs/tags/v')
        with:
          name: ${{ env.APP }} ${{ env.VER }}
          draft: true
          generate_release_notes: true
          files: |
            dist-*/*/*/*.tar.bz2
            dist-*/*/*/*.zip
      - name: Add VirusTotal Info to Release Notes
        if: startsWith(github.ref, 'refs/tags/v')
        run: |
          # github api url
          url=https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.generate_release_notes.outputs.id }}
          echo "url: $url"

          # get release notes
          release=$(
            curl \
              -s \
              -L \
              -H "Accept: application/vnd.github+json" \
              -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
              -H "X-GitHub-Api-Version: 2022-11-28" \
              $url
          )
          tag_name=$(jq -r .tag_name <<< "$release")
          target_commitish=$(jq -r .target_commitish <<< "$release")
          body=$(jq -r .body <<< "$release")

          echo "tag_name: $tag_name target_commitish: $target_commitish"

          # append virustotal details to release notes
          nl=$'\n'
          body+="$nl$nl[VirusTotal](https://www.virustotal.com) analysis:$nl"
          while read -r -d, line; do
            name=$(sed -e 's/^\.\/scan\/\([^=]\+\)=.*/\1/' <<< "$line")
            vturl=$(sed -e 's/.*=\(https.*\)/\1/' <<< "$line")
            body+="* [$name]($vturl)$nl"
          done <<< "${{ steps.virustotal.outputs.analysis }},"

          echo -e "body:\n$body"

          # update release notes
          export tag_name target_commitish body
          curl \
            -s \
            -L \
            -X PATCH \
            -H "Accept: application/vnd.github+json" \
            -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
            -H "X-GitHub-Api-Version: 2022-11-28" \
            --variable '%tag_name' \
            --varable '%target_commitish' \
            --variable '%body' \
            --expand-data '{"tag_name": "{{tag_name:json}}", "body": "{{body:trim:json}}"}' \
            $url


================================================
FILE: .github/workflows/test.yml
================================================
on: [push, pull_request]
name: Test usql
jobs:
  test:
    name: Build and Test usql
    runs-on: ubuntu-latest
    services:
      cassandra:
        image: docker.io/usql/cassandra:latest
        ports:
          - 9042:9042
      postgres:
        image: docker.io/usql/postgres:latest
        env:
          POSTGRES_PASSWORD: P4ssw0rd
        ports:
          - 5432:5432
      mysql:
        image: docker.io/library/mariadb
        env:
          MYSQL_ROOT_PASSWORD: P4ssw0rd
        ports:
          - 3306:3306
      sqlserver:
        image: mcr.microsoft.com/mssql/server:2022-latest
        env:
          ACCEPT_EULA: Y
          MSSQL_PID: Express
          SA_PASSWORD: Adm1nP@ssw0rd
        ports:
          - 1433:1433
    steps:
      - name: Install Go
        uses: actions/setup-go@v5
        with:
          go-version: stable
      - name: Install Packages
        run: |
          sudo apt-get -qq update
          sudo apt-get install -y build-essential libicu-dev unixodbc unixodbc-dev
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Unit Tests
        run: |
          go test -v ./stmt
      - name: Build with all drivers
        run: |
          ./build.sh -b -t all
      - name: Shell Tests
        run: |
          go run testcli.go &> output.log
          ls -alh output.log
      - name: Archive output
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: output
          path: output.log
          if-no-files-found: error


================================================
FILE: .gitignore
================================================
/usql
/usql.exe
/build/
/coverage.out
/*.sql
/*.txt

.usql_history*
.[a-f0-9]*

*.ini
*.csv
*.db
*.zip
*.out

*.sqlite3
*.sqlite3-journal
*.duckdb
*.wal

/instantclient*
/*.pc

.vscode/


================================================
FILE: CONTRIBUTING.md
================================================
Contributing to usql
====================

Any contributions are welcome. If you found a bug, or a missing feature,
take a look at existing [issues](https://github.com/xo/usql/issues)
and create a new one if needed.

You can also open up a [pull request](https://github.com/xo/usql/pulls) (PR)
with code or documentation changes.

# Adding a new driver

1. Add a new schema in [dburl](https://github.com/xo/dburl).
1. Create a new go package in `drivers`. It should have an `init()` function, that would call `drivers.Register()`.
1. Regenerate code in the `internal` package by running `internal/gen.sh`.
1. Add any new required modules using `go get` or by editing `go.mod` manually and running `go mod tidy`.
1. Run all tests, build `usql` and see if the new driver works.
1. Update `README.md`.

> Tip: check out closed PRs for examples, and/or search the codebase
for names of databases you're familiar with.

# Enabling metadata introspection for a driver

For `\d*` commands to work, `usql` needs to know how to read the structure of a database.
A driver must provide a metadata reader, by setting the `NewMetadataReader` property
in the `drivers.Driver` structure passed to `drivers.Register()`. This needs to be a function
that given a database and reader options, returns a reader instance for this particular driver.

If the database has a `information_schema` schema, with standard tables like `tables` and `columns`,
you can use an existing reader from the `drivers/informationschema` package.
Since there are usually minor difference in objects defined in that schema in different databases,
there's a set of options to configure this reader. Refer to
the [package docs](https://pkg.go.dev/github.com/xo/usql/drivers/metadata/informationschema) for details.

If you can't use the `informationschema` reader, consider implementing a new one.
It should implement at least one of the following reader interfaces:
* CatalogReader
* SchemaReader
* TableReader
* ColumnReader
* IndexReader
* IndexColumnReader
* FunctionReader
* FunctionColumnReader
* SequenceReader

Every of these interfaces consist of a single function, that takes a `Filter` structure as an argument,
and returns a set of results and an error.

Example drivers using their own readers include:
* `sqlite3`
* `oracle` and `godror` sharing the same reader

If you want to use the `informationschema` reader, but need to override one or more readers,
use the `metadata.NewPluginReader(readers ...Reader)` function. It returns an object calling
reader functions from the last reader passed in the arguments, that implements it.

Example drivers extending an `informationschema` reader using a plugin reader:
* `postgres`

`\d*` commands are actually implemented by a metadata writer. There's currently only one,
but it too can be replaced and/or extended.

# Enabling autocomplete for a driver

If a driver provides a metadata reader, the default completer will use it.
A driver can provide it's own completer, by setting the `NewCompleter` property
in the `drivers.Driver` structure passed to `drivers.Register()`.


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2015-2025 Kenneth Shaw

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
<div align="center">
  <img src="https://raw.githubusercontent.com/xo/usql-logo/master/usql.png" height="120">
</div>

<div align="center">
  <a href="#installing" title="Installing">Installing</a> |
  <a href="#building" title="Building">Building</a> |
  <a href="#database-support" title="Database Support">Database Support</a> |
  <a href="#using" title="Using">Using</a> |
  <a href="#features-and-compatibility" title="Features and Compatibility">Features and Compatibility</a> |
  <a href="https://github.com/xo/usql/releases" title="Releases">Releases</a> |
  <a href="#contributing" title="Contributing">Contributing</a>
</div>

<br/>

`usql` is a universal command-line interface for PostgreSQL, MySQL, Oracle
Database, SQLite3, Microsoft SQL Server, [and many other databases][databases]
including NoSQL and non-relational databases!

`usql` provides a simple way to work with [SQL and NoSQL databases][databases]
via a command-line inspired by PostgreSQL's `psql`. `usql` supports most of the
core `psql` features, such as [variables][variables], [backticks][backticks],
[backslash commands][commands] and has additional features that `psql` does
not, such as [multiple database support][databases], [copying between databases][copying],
[syntax highlighting][highlighting], [context-based completion][completion],
and [terminal graphics][termgraphics].

Database administrators and developers that would prefer to work with a tool
like `psql` with non-PostgreSQL databases, will find `usql` intuitive,
easy-to-use, and a great replacement for the command-line clients/tools
for other databases.

[![Unit Tests][usql-ci-status]][usql-ci]
[![Go Reference][goref-usql-status]][goref-usql]
[![Releases][release-status]][Releases]
[![Discord Discussion][discord-status]][discord]

[usql-ci]: https://github.com/xo/usql/actions/workflows/test.yml "Test CI"
[usql-ci-status]: https://github.com/xo/usql/actions/workflows/test.yml/badge.svg "Test CI"
[goref-usql]: https://pkg.go.dev/github.com/xo/usql "Go Reference"
[goref-usql-status]: https://pkg.go.dev/badge/github.com/xo/usql.svg "Go Reference"
[release-status]: https://img.shields.io/github/v/release/xo/usql?display_name=tag&sort=semver "Latest Release"
[discord]: https://discord.gg/WDWAgXwJqN "Discord Discussion"
[discord-status]: https://img.shields.io/discord/829150509658013727.svg?label=Discord&logo=Discord&colorB=7289da&style=flat-square "Discord Discussion"
[installing]: #installing "Installing"
[databases]: #database-support "Database Support"
[releases]: https://github.com/xo/usql/releases "Releases"

## Installing

`usql` can be installed [via Release][], [via Homebrew][], [via AUR][], [via
Scoop][], [via Go][], or [via Docker][]:

[via Release]: #installing-via-release
[via Homebrew]: #installing-via-homebrew-macos-and-linux
[via AUR]: #installing-via-aur-arch-linux
[via Scoop]: #installing-via-scoop-windows
[via Go]: #installing-via-go
[via Docker]: #installing-via-docker

### Installing via Release

1. [Download a release for your platform][releases]
2. Extract the `usql` or `usql.exe` file from the `.tar.bz2` or `.zip` file
3. Move the extracted executable to somewhere on your `$PATH` (Linux/macOS) or
   `%PATH%` (Windows)

### Installing via Homebrew (macOS and Linux)

Install `usql` from the [`xo/xo` tap][xo-tap] in the usual way with the [`brew`
command][homebrew]:

```sh
# install usql with most drivers
$ brew install xo/xo/usql
```

Support for [ODBC databases][databases] is available through the `--with-odbc`
install flag:

```sh
# add xo tap
$ brew tap xo/xo

# install usql with odbc support
$ brew install --with-odbc usql
```

### Installing via AUR (Arch Linux)

Install `usql` from the [Arch Linux AUR][aur] in the usual way with the [`yay`
command][yay]:

```sh
# install usql with most drivers
$ yay -S usql
```

Alternately, build and [install using `makepkg`][arch-makepkg]:

```sh
$ git clone https://aur.archlinux.org/usql.git && cd usql
$ makepkg -si
==> Making package: usql 0.12.10-1 (Fri 26 Aug 2022 05:56:09 AM WIB)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading usql-0.12.10.tar.gz...
...
```

### Installing via Scoop (Windows)

Install `usql` using [Scoop](https://scoop.sh):

```powershell
# Optional: Needed to run a remote script the first time
> Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

# install scoop if not already installed
> irm get.scoop.sh | iex

# install usql with scoop
> scoop install usql
```

### Installing via Go

Install `usql` in the usual Go fashion:

```sh
# install latest usql version with base drivers
$ go install github.com/xo/usql@latest

# alternately, install usql with most drivers (see below for info about build tags)
$ go install -tags most github.com/xo/usql@latest
```

See [below for information](#building) on `usql` build tags.

### Installing via Docker

An [official container image (`docker.io/usql/usql`)][docker-hub] is maintained
by the `usql` team, and can be used with Docker, Podman, or other container
runtime.

[docker-hub]: https://hub.docker.com/r/usql/usql

Install `usql` with Docker, Podman, or other container runtime:

```sh
# run interactive shell and mount the $PWD/data directory as a volume for use
# within the container
$ docker run --rm -it --volume $(pwd)/data:/data docker.io/usql/usql:latest sqlite3://data/test.db
Trying to pull docker.io/usql/usql:latest...
Getting image source signatures
Copying blob af48168d69d8 done   |
Copying blob efc2b5ad9eec skipped: already exists
Copying config 917ceb411d done   |
Writing manifest to image destination
Connected with driver sqlite3 (SQLite3 3.45.1)
Type "help" for help.

sq:data/test.db=> \q

# run postgres locally
$ docker run --detach --rm --name=postgres --publish=5432:5432 --env=POSTGRES_PASSWORD=P4ssw0rd docker.io/usql/postgres

# connect to local postgres instance
$ docker run --rm --network host -it docker.io/usql/usql:latest postgres://postgres:P4ssw0rd@localhost
Connected with driver postgres (PostgreSQL 16.3 (Debian 16.3-1.pgdg120+1))
Type "help" for help.

pg:postgres@localhost=> \q

# run specific usql version
$ docker run --rm -it docker.io/usql/usql:0.19.3
```

## Building

When building `usql` out-of-the-box with `go build` or `go install`, only the
[`base` drivers][databases] for PostgreSQL, MySQL, SQLite3, Microsoft SQL
Server, Oracle, CSVQ will be included in the build:

```sh
# build/install with base drivers (PostgreSQL, MySQL, SQLite3, Microsoft SQL Server,
# Oracle, CSVQ)
$ go install github.com/xo/usql@master
```

Other databases can be enabled by specifying the [build tag for their database
driver][databases].

```sh
# build/install with base, Avatica, and ODBC drivers
$ go install -tags 'avatica odbc' github.com/xo/usql@master
```

For every build tag `<driver>`, there is also a `no_<driver>` build tag
that will disable the driver:

```sh
# build/install most drivers, excluding Avatica, Couchbase, and PostgreSQL
$ go install -tags 'most no_avatica no_couchbase no_postgres' github.com/xo/usql@master
```

By specifying the build tags `most` or `all`, the build will include most, and
all SQL drivers, respectively:

```sh
# build/install with most drivers (excludes CGO drivers and problematic drivers)
$ go install -tags most github.com/xo/usql@master

# build/install all drivers (includes CGO drivers and problematic drivers)
$ go install -tags all github.com/xo/usql@master
```

## Database Support

`usql` works with all Go standard library compatible SQL drivers supported by
[`github.com/xo/dburl`][dburl].

The list of drivers that `usql` was built with can be displayed with the
[`\drivers` command][commands]:

```sh
$ cd $GOPATH/src/github.com/xo/usql

# build excluding the base drivers, and including cassandra and moderncsqlite
$ go build -tags 'no_postgres no_oracle no_sqlserver no_sqlite3 cassandra moderncsqlite'

# show built driver support
$ ./usql -c '\drivers'
Available Drivers:
  cql [ca, scy, scylla, datastax, cassandra]
  memsql (mysql) [me]
  moderncsqlite [mq, sq, file, sqlite, sqlite3, modernsqlite]
  mysql [my, maria, aurora, mariadb, percona]
  tidb (mysql) [ti]
  vitess (mysql) [vt]
```

The above shows that `usql` was built with only the `mysql`, `cassandra` (ie,
`cql`), and `moderncsqlite` drivers. The output above reflects information
about the drivers available to `usql`, specifically the internal driver name,
its primary URL scheme, the driver's available scheme aliases (shown in
`[...]`), and the real/underlying driver (shown in `(...)`) for wire compatible
drivers.

### Supported Database Schemes and Aliases

The following are the [Go SQL drivers][go-sql] that `usql` supports, the
associated database, scheme / build tag, and scheme aliases:

<!-- DRIVER DETAILS START -->

| Database             | Scheme / Tag    | Scheme Aliases                                  | Driver Package / Notes                                                      |
| -------------------- | --------------- | ----------------------------------------------- | --------------------------------------------------------------------------- |
| PostgreSQL           | `postgres`      | `pg`, `pgsql`, `postgresql`                     | [github.com/lib/pq][d-postgres]                                             |
| MySQL                | `mysql`         | `my`, `maria`, `aurora`, `mariadb`, `percona`   | [github.com/go-sql-driver/mysql][d-mysql]                                   |
| Microsoft SQL Server | `sqlserver`     | `ms`, `mssql`, `azuresql`                       | [github.com/microsoft/go-mssqldb][d-sqlserver]                              |
| Oracle Database      | `oracle`        | `or`, `ora`, `oci`, `oci8`, `odpi`, `odpi-c`    | [github.com/sijms/go-ora/v2][d-oracle]                                      |
| SQLite3              | `sqlite3`       | `sq`, `sqlite`, `file`                          | [github.com/mattn/go-sqlite3][d-sqlite3] <sup>[†][f-cgo]</sup>              |
| ClickHouse           | `clickhouse`    | `ch`                                            | [github.com/ClickHouse/clickhouse-go/v2][d-clickhouse]                      |
| CSVQ                 | `csvq`          | `cs`, `csv`, `tsv`, `json`                      | [github.com/mithrandie/csvq-driver][d-csvq]                                 |
|                      |                 |                                                 |                                                                             |
| Alibaba MaxCompute   | `maxcompute`    | `mc`                                            | [sqlflow.org/gomaxcompute][d-maxcompute]                                    |
| Alibaba Tablestore   | `ots`           | `ot`, `tablestore`                              | [github.com/aliyun/aliyun-tablestore-go-sql-driver][d-ots]                  |
| Apache Avatica       | `avatica`       | `av`, `phoenix`                                 | [github.com/apache/calcite-avatica-go/v5][d-avatica]                        |
| Apache H2            | `h2`            |                                                 | [github.com/jmrobles/h2go][d-h2]                                            |
| Apache Hive          | `hive`          | `hi`, `hive2`                                   | [sqlflow.org/gohive][d-hive]                                                |
| Apache Ignite        | `ignite`        | `ig`, `gridgain`                                | [github.com/amsokol/ignite-go-client/sql][d-ignite]                         |
| Apache Impala        | `impala`        | `im`                                            | [github.com/sclgo/impala-go][d-impala]                                      |
| AWS Athena           | `athena`        | `s3`, `aws`, `awsathena`                        | [github.com/uber/athenadriver/go][d-athena]                                 |
| Azure CosmosDB       | `cosmos`        | `cm`, `gocosmos`                                | [github.com/btnguyen2k/gocosmos][d-cosmos]                                  |
| Cassandra            | `cassandra`     | `ca`, `scy`, `scylla`, `datastax`, `cql`        | [github.com/MichaelS11/go-cql-driver][d-cassandra]                          |
| ChaiSQL              | `chai`          | `ci`, `genji`, `chaisql`                        | [github.com/chaisql/chai][d-chai]                                           |
| Couchbase            | `couchbase`     | `n1`, `n1ql`                                    | [github.com/couchbase/go_n1ql][d-couchbase]                                 |
| Cznic QL             | `ql`            | `cznic`, `cznicql`                              | [modernc.org/ql][d-ql]                                                      |
| Databend             | `databend`      | `dd`, `bend`                                    | [github.com/datafuselabs/databend-go][d-databend]                           |
| Databricks           | `databricks`    | `br`, `brick`, `bricks`, `databrick`            | [github.com/databricks/databricks-sql-go][d-databricks]                     |
| DuckDB               | `duckdb`        | `dk`, `ddb`, `duck`, `file`                     | [github.com/duckdb/duckdb-go/v2][d-duckdb] <sup>[†][f-cgo]</sup>            |
| DynamoDb             | `dynamodb`      | `dy`, `dyn`, `dynamo`, `dynamodb`               | [github.com/btnguyen2k/godynamo][d-dynamodb]                                |
| Exasol               | `exasol`        | `ex`, `exa`                                     | [github.com/exasol/exasol-driver-go][d-exasol]                              |
| Firebird             | `firebird`      | `fb`, `firebirdsql`                             | [github.com/nakagami/firebirdsql][d-firebird]                               |
| FlightSQL            | `flightsql`     | `fl`, `flight`                                  | [github.com/apache/arrow/go/v17/arrow/flight/flightsql/driver][d-flightsql] |
| Google BigQuery      | `bigquery`      | `bq`                                            | [gorm.io/driver/bigquery/driver][d-bigquery]                                |
| Google Spanner       | `spanner`       | `sp`                                            | [github.com/googleapis/go-sql-spanner][d-spanner]                           |
| Microsoft ADODB      | `adodb`         | `ad`, `ado`                                     | [github.com/mattn/go-adodb][d-adodb]                                        |
| ModernC SQLite3      | `moderncsqlite` | `mq`, `modernsqlite`                            | [modernc.org/sqlite][d-moderncsqlite]                                       |
| MySQL MyMySQL        | `mymysql`       | `zm`, `mymy`                                    | [github.com/ziutek/mymysql/godrv][d-mymysql]                                |
| Netezza              | `netezza`       | `nz`, `nzgo`                                    | [github.com/IBM/nzgo/v12][d-netezza]                                        |
| PostgreSQL PGX       | `pgx`           | `px`                                            | [github.com/jackc/pgx/v5/stdlib][d-pgx]                                     |
| Presto               | `presto`        | `pr`, `prs`, `prestos`, `prestodb`, `prestodbs` | [github.com/prestodb/presto-go-client/presto][d-presto]                     |
| RamSQL               | `ramsql`        | `rm`, `ram`                                     | [github.com/proullon/ramsql/driver][d-ramsql]                               |
| SAP ASE              | `sapase`        | `ax`, `ase`, `tds`                              | [github.com/thda/tds][d-sapase]                                             |
| SAP HANA             | `saphana`       | `sa`, `sap`, `hana`, `hdb`                      | [github.com/SAP/go-hdb/driver][d-saphana]                                   |
| Snowflake            | `snowflake`     | `sf`                                            | [github.com/snowflakedb/gosnowflake][d-snowflake]                           |
| Trino                | `trino`         | `tr`, `trs`, `trinos`                           | [github.com/trinodb/trino-go-client/trino][d-trino]                         |
| Vertica              | `vertica`       | `ve`                                            | [github.com/vertica/vertica-sql-go][d-vertica]                              |
| VoltDB               | `voltdb`        | `vo`, `vdb`, `volt`                             | [github.com/VoltDB/voltdb-client-go/voltdbclient][d-voltdb]                 |
| YDB                  | `ydb`           | `yd`, `yds`, `ydbs`                             | [github.com/ydb-platform/ydb-go-sdk/v3][d-ydb]                              |
|                      |                 |                                                 |                                                                             |
| GO DRiver for ORacle | `godror`        | `gr`                                            | [github.com/godror/godror][d-godror] <sup>[†][f-cgo]</sup>                  |
| ODBC                 | `odbc`          | `od`                                            | [github.com/alexbrainman/odbc][d-odbc] <sup>[†][f-cgo]</sup>                |
|                      |                 |                                                 |                                                                             |
| Amazon Redshift      | `postgres`      | `rs`, `redshift`                                | [github.com/lib/pq][d-postgres] <sup>[‡][f-wire]</sup>                      |
| CockroachDB          | `postgres`      | `cr`, `cdb`, `crdb`, `cockroach`, `cockroachdb` | [github.com/lib/pq][d-postgres] <sup>[‡][f-wire]</sup>                      |
| OLE ODBC             | `adodb`         | `oo`, `ole`, `oleodbc`                          | [github.com/mattn/go-adodb][d-adodb] <sup>[‡][f-wire]</sup>                 |
| SingleStore MemSQL   | `mysql`         | `me`, `memsql`                                  | [github.com/go-sql-driver/mysql][d-mysql] <sup>[‡][f-wire]</sup>            |
| TiDB                 | `mysql`         | `ti`, `tidb`                                    | [github.com/go-sql-driver/mysql][d-mysql] <sup>[‡][f-wire]</sup>            |
| Vitess Database      | `mysql`         | `vt`, `vitess`                                  | [github.com/go-sql-driver/mysql][d-mysql] <sup>[‡][f-wire]</sup>            |
|                      |                 |                                                 |                                                                             |
|                      |                 |                                                 |                                                                             |
|                      |                 |                                                 |                                                                             |
| **NO DRIVERS**       | `no_base`       |                                                 | _no base drivers (useful for development)_                                  |
| **MOST DRIVERS**     | `most`          |                                                 | _all stable drivers_                                                        |
| **ALL DRIVERS**      | `all`           |                                                 | _all drivers, excluding bad drivers_                                        |
| **BAD DRIVERS**      | `bad`           |                                                 | _bad drivers (broken/non-working drivers)_                                  |
| **NO &lt;TAG&gt;**   | `no_<tag>`      |                                                 | _exclude driver with `<tag>`_                                               |

[d-adodb]: https://github.com/mattn/go-adodb
[d-athena]: https://github.com/uber/athenadriver
[d-avatica]: https://github.com/apache/calcite-avatica-go
[d-bigquery]: https://github.com/go-gorm/bigquery
[d-cassandra]: https://github.com/MichaelS11/go-cql-driver
[d-chai]: https://github.com/chaisql/chai
[d-clickhouse]: https://github.com/ClickHouse/clickhouse-go
[d-cosmos]: https://github.com/btnguyen2k/gocosmos
[d-couchbase]: https://github.com/couchbase/go_n1ql
[d-csvq]: https://github.com/mithrandie/csvq-driver
[d-databend]: https://github.com/datafuselabs/databend-go
[d-databricks]: https://github.com/databricks/databricks-sql-go
[d-duckdb]: https://github.com/duckdb/duckdb-go
[d-dynamodb]: https://github.com/btnguyen2k/godynamo
[d-exasol]: https://github.com/exasol/exasol-driver-go
[d-firebird]: https://github.com/nakagami/firebirdsql
[d-flightsql]: https://github.com/apache/arrow/tree/main/go/arrow/flight/flightsql/driver
[d-godror]: https://github.com/godror/godror
[d-h2]: https://github.com/jmrobles/h2go
[d-hive]: https://github.com/sql-machine-learning/gohive
[d-ignite]: https://github.com/amsokol/ignite-go-client
[d-impala]: https://github.com/sclgo/impala-go
[d-maxcompute]: https://github.com/sql-machine-learning/gomaxcompute
[d-moderncsqlite]: https://gitlab.com/cznic/sqlite
[d-mymysql]: https://github.com/ziutek/mymysql
[d-mysql]: https://github.com/go-sql-driver/mysql
[d-netezza]: https://github.com/IBM/nzgo
[d-odbc]: https://github.com/alexbrainman/odbc
[d-oracle]: https://github.com/sijms/go-ora
[d-ots]: https://github.com/aliyun/aliyun-tablestore-go-sql-driver
[d-pgx]: https://github.com/jackc/pgx
[d-postgres]: https://github.com/lib/pq
[d-presto]: https://github.com/prestodb/presto-go-client
[d-ql]: https://gitlab.com/cznic/ql
[d-ramsql]: https://github.com/proullon/ramsql
[d-sapase]: https://github.com/thda/tds
[d-saphana]: https://github.com/SAP/go-hdb
[d-snowflake]: https://github.com/snowflakedb/gosnowflake
[d-spanner]: https://github.com/googleapis/go-sql-spanner
[d-sqlite3]: https://github.com/mattn/go-sqlite3
[d-sqlserver]: https://github.com/microsoft/go-mssqldb
[d-trino]: https://github.com/trinodb/trino-go-client
[d-vertica]: https://github.com/vertica/vertica-sql-go
[d-voltdb]: https://github.com/VoltDB/voltdb-client-go
[d-ydb]: https://github.com/ydb-platform/ydb-go-sdk

<!-- DRIVER DETAILS END -->

[f-cgo]: #f-cgo "Requires CGO"
[f-wire]: #f-wire "Wire compatible"

<p>
  <i>
    <a id="f-cgo"><sup>†</sup> Requires CGO</a><br>
    <a id="f-wire"><sup>‡</sup> Wire compatible (see respective driver)</a>
  </i>
</p>

Any of the protocol schemes/aliases above can be used in conjunction when
connecting to a database via the command-line or with the [`\connect` and
`\copy` commands][commands]:

```sh
# connect to a vitess database:
$ usql vt://user:pass@host:3306/mydatabase

$ usql
(not connected)=> \c vitess://user:pass@host:3306/mydatabase

$ usql
(not connected)=> \copy csvq://. pg://localhost/ 'select * ....' 'myTable'
```

See [the section below on connecting to databases][connecting] for further
details building DSNs/URLs for use with `usql`.

## Using

After [installing][], `usql` can be used similarly to the following:

```sh
# connect to a postgres database
$ usql postgres://booktest@localhost/booktest

# connect to an oracle database
$ usql oracle://user:pass@host/oracle.sid

# connect to a postgres database and run the commands contained in script.sql
$ usql pg://localhost/ -f script.sql
```

### Command-line Options

Supported command-line options:

```sh
$ usql --help
usql, the universal command-line interface for SQL databases

Usage:
  usql [flags]... [DSN]

Arguments:
  DSN   database url or connection name

Flags:
  -c, --command COMMAND                     run only single command (SQL or internal) and exit
  -f, --file FILE                           execute commands from file and exit
  -w, --no-password                         never prompt for password
  -X, --no-init                             do not execute initialization scripts (aliases: --no-rc --no-psqlrc --no-usqlrc)
  -o, --out FILE                            output file
  -W, --password                            force password prompt (should happen automatically)
  -1, --single-transaction                  execute as a single transaction (if non-interactive)
  -v, --set NAME=VALUE                      set variable NAME to VALUE (see \set command, aliases: --var --variable)
  -N, --cset NAME=DSN                       set named connection NAME to DSN (see \cset command)
  -P, --pset VAR=ARG                        set printing option VAR to ARG (see \pset command)
  -F, --field-separator FIELD-SEPARATOR     field separator for unaligned and CSV output (default "|" and ",")
  -R, --record-separator RECORD-SEPARATOR   record separator for unaligned and CSV output (default \n)
  -T, --table-attr TABLE-ATTR               set HTML table tag attributes (e.g., width, border)
  -A, --no-align                            unaligned table output mode
  -H, --html                                HTML table output mode
  -t, --tuples-only                         print rows only
  -x, --expanded                            turn on expanded table output
  -z, --field-separator-zero                set field separator for unaligned and CSV output to zero byte
  -0, --record-separator-zero               set record separator for unaligned and CSV output to zero byte
  -J, --json                                JSON output mode
  -C, --csv                                 CSV output mode
  -G, --vertical                            vertical output mode
  -q, --quiet                               run quietly (no messages, only query output)
      --config string                       config file
  -V, --version                             output version information, then exit
  -?, --help                                show this help, then exit
```

### Connecting to Databases

`usql` opens a database connection by [parsing a URL][dburl] and passing the
resulting connection string to [a database driver][databases]. Database
connection strings (aka "data source name" or DSNs) have the same parsing rules
as URLs, and can be passed to `usql` via command-line, or to the [`\connect`,
`\c`, and `\copy` commands][commands].

Database connections can be defined with [the `\cset` command][connection-vars]
or in [the `config.yaml` configuration file][config].

#### Database Connection Strings

Database connection strings look like the following:

```txt
  driver+transport://user:pass@host/dbname?opt1=a&opt2=b
  driver:/path/to/file
  /path/to/file
  name
```

Where the above are:

| Component                       | Description                                                                          |
| ------------------------------- | ------------------------------------------------------------------------------------ |
| `driver`                        | driver scheme name or scheme alias                                                   |
| `transport`                     | `tcp`, `udp`, `unix` or driver name <i>(for ODBC and ADODB)</i>                      |
| `user`                          | username                                                                             |
| `pass`                          | password                                                                             |
| `host`                          | hostname                                                                             |
| `dbname` <sup>[±][f-path]</sup> | database name, instance, or service name/ID                                          |
| `?opt1=a&...`                   | additional database driver options (see respective SQL driver for available options) |
| `/path/to/file`                 | a path on disk                                                                       |
| `name`                          | a connection name set by [`\cset`][connection-vars] or in [`config.yaml`][config]    |

[f-path]: #f-path "URL Paths for Databases"

<p>
  <i>
    <a id="f-path">
      <sup>±</sup> Some databases, such as Microsoft SQL Server, or Oracle
      Database support a path component (ie, <code>/dbname</code>) in the form
      of <code>/instance/dbname</code>, where <code>/instance</code> is the
      optional service identifier (aka "SID") or database instance
    </a>
  </i>
</p>

#### Driver Aliases

`usql` supports the same driver names and aliases as [the `dburl`
package][dburl]. Databases have at least one or more aliases. See [`dburl`'s
scheme documentation][dburl-schemes] for a list of all supported aliases.

##### Short Aliases

All database drivers have a two character short form that is usually the first
two letters of the database driver. For example, `pg` for `postgres`, `my` for
`mysql`, `ms` for `sqlserver`, `or` for `oracle`, or `sq` for `sqlite3`.

#### Passing Driver Options

Driver options are specified as standard URL query options in the form of
`?opt1=a&opt2=b`. Refer to the [relevant database driver's documentation][databases]
for available options.

#### Paths on Disk

If a URL does not have a `driver:` scheme, `usql` will check if it is a path on
disk. If the path exists, `usql` will attempt to use an appropriate database
driver to open the path.

When the path is a Unix Domain Socket, `usql` will attempt to open it with the
MySQL driver. When the path is a directory, `usql` will attempt to open it
using the PostgreSQL driver. And, lastly, when the path is a regular file,
`usql` will attempt to open the file using the SQLite3 or DuckDB drivers.

#### Driver Defaults

As with URLs, most components in the URL are optional and many components can
be left out. `usql` will attempt connecting using defaults where possible:

```sh
# connect to postgres using the local $USER and the unix domain socket in /var/run/postgresql
$ usql pg://
```

See the relevant documentation [on database drivers][databases] for more
information.

### Connection Examples

The following are example connection strings and additional ways to connect to
databases using `usql`:

```sh
# connect to a postgres database
$ usql pg://user:pass@host/dbname
$ usql pgsql://user:pass@host/dbname
$ usql postgres://user:pass@host:port/dbname
$ usql pg://
$ usql /var/run/postgresql
$ usql pg://user:pass@host/dbname?sslmode=disable # Connect without SSL

# connect to a mysql database
$ usql my://user:pass@host/dbname
$ usql mysql://user:pass@host:port/dbname
$ usql my://
$ usql /var/run/mysqld/mysqld.sock

# connect to a sqlserver database
$ usql sqlserver://user:pass@host/instancename/dbname
$ usql ms://user:pass@host/dbname
$ usql ms://user:pass@host/instancename/dbname
$ usql mssql://user:pass@host:port/dbname
$ usql ms://

# connect to a sqlserver database using Windows domain authentication
$ runas /user:ACME\wiley /netonly "usql mssql://host/dbname/"

# connect to a oracle database
$ usql or://user:pass@host/sid
$ usql oracle://user:pass@host:port/sid
$ usql or://

# connect to a cassandra database
$ usql ca://user:pass@host/keyspace
$ usql cassandra://host/keyspace
$ usql cql://host/
$ usql ca://

# connect to a sqlite database that exists on disk
$ usql dbname.sqlite3

# Note: when connecting to a SQLite database, if the "driver://" or
# "driver:" scheme/alias is omitted, the file must already exist on disk.
#
# if the file does not yet exist, the URL must incorporate file:, sq:, sqlite3:,
# or any other recognized sqlite3 driver alias to force usql to create a new,
# empty database at the specified path:
$ usql sq://path/to/dbname.sqlite3
$ usql sqlite3://path/to/dbname.sqlite3
$ usql file:/path/to/dbname.sqlite3

# connect to a adodb ole resource (windows only)
$ usql adodb://Microsoft.Jet.OLEDB.4.0/myfile.mdb
$ usql "adodb://Microsoft.ACE.OLEDB.12.0/?Extended+Properties=\"Text;HDR=NO;FMT=Delimited\""

# connect to a named connection in $HOME/.config/usql/config.yaml
$ cat $HOME/.config/usql/config.yaml
connections:
  my_named_connection: sqlserver://user:pass@localhost/
$ usql my_named_connection

# connect with ODBC driver (requires building with odbc tag)
$ cat /etc/odbcinst.ini
[DB2]
Description=DB2 driver
Driver=/opt/db2/clidriver/lib/libdb2.so
FileUsage = 1
DontDLClose = 1

[PostgreSQL ANSI]
Description=PostgreSQL ODBC driver (ANSI version)
Driver=psqlodbca.so
Setup=libodbcpsqlS.so
Debug=0
CommLog=1
UsageCount=1

# connect to db2, postgres databases using odbc config above
$ usql odbc+DB2://user:pass@localhost/dbname
$ usql odbc+PostgreSQL+ANSI://user:pass@localhost/dbname?TraceFile=/path/to/trace.log
```

See the [section on connection variables][connection-vars] for information on
defining connection names.

### Executing Queries and Commands

The interactive interpreter reads queries and [backslash meta (`\`) commands][commands],
sending the query to the connected database:

```sh
$ usql sqlite://example.sqlite3
Connected with driver sqlite3 (SQLite3 3.17.0)
Type "help" for help.

sq:example.sqlite3=> create table test (test_id int, name string);
CREATE TABLE
sq:example.sqlite3=> insert into test (test_id, name) values (1, 'hello');
INSERT 1
sq:example.sqlite3=> select * from test;
  test_id | name
+---------+-------+
        1 | hello
(1 rows)

sq:example.sqlite3=> select * from test
sq:example.sqlite3-> \p
select * from test
sq:example.sqlite3-> \g
  test_id | name
+---------+-------+
        1 | hello
(1 rows)

sq:example.sqlite3=> \c postgres://booktest@localhost
error: pq: 28P01: password authentication failed for user "booktest"
Enter password:
Connected with driver postgres (PostgreSQL 9.6.6)
pg:booktest@localhost=> select * from authors;
  author_id |      name
+-----------+----------------+
          1 | Unknown Master
          2 | blah
          3 | foobar
(3 rows)

pg:booktest@localhost=>
```

Commands may accept one or more parameter, and can be quoted using either `'`
or `"`. Command parameters [may also be backticked][backticks].

### Backslash Commands

`usql` supports interleaved backslash (`\`) meta commands to modify or alter
the way that `usql` interprets queries, formats its output, and changes the
resulting interactive flow.

```sh
(not connected)=> \c postgres://user:pass@localhost
pg:user@localhost=> select * from my_table \G
```

Available backslash meta commands can be displayed with `\?`:

```sh
$ usql
Type "help" for help.

(not connected)=> \?
General
  \q                                quit usql
  \quit                             alias for \q
  \copyright                        show usage and distribution terms for usql
  \drivers                          show database drivers available to usql

Help
  \? [commands]                     show help on usql's meta (backslash) commands
  \? options                        show help on usql command-line options
  \? variables                      show help on special usql variables

Connection
  \c DSN or \c NAME                 connect to dsn or named database connection
  \c DRIVER PARAMS...               connect to database with driver and parameters
  \connect                          alias for \c
  \Z                                close (disconnect) database connection
  \disconnect                       alias for \Z
  \password [USER]                  change password for user
  \passwd                           alias for \password
  \conninfo                         display information about the current database connection

Query Execute
  \g [(OPTIONS)] [FILE] or ;        execute query (and send results to file or |pipe)
  \go                               alias for \g
  \G [(OPTIONS)] [FILE]             as \g, but forces vertical output mode
  \ego                              alias for \G
  \gx [(OPTIONS)] [FILE]            as \g, but forces expanded output mode
  \gexec                            execute query and execute each value of the result
  \gset [PREFIX]                    execute query and store results in usql variables
  \bind [PARAM]...                  set query parameters
  \timing [on|off]                  toggle timing of commands

Query View
  \crosstab [(OPTIONS)] [COLUMNS]   execute query and display results in crosstab
  \crosstabview                     alias for \crosstab
  \xtab                             alias for \crosstab
  \chart CHART [(OPTIONS)]          execute query and display results as a chart
  \watch [(OPTIONS)] [INTERVAL]     execute query every specified interval

Query Buffer
  \e [-raw|-exec] [FILE] [LINE]     edit the query buffer, raw (non-interpolated) buffer, the
                                    exec buffer, or a file with external editor
  \edit                             alias for \e
  \p [-raw|-exec]                   show the contents of the query buffer, the raw
                                    (non-interpolated) buffer or the exec buffer
  \print                            alias for \p
  \raw                              alias for \p
  \exec                             alias for \p
  \w [-raw|-exec] FILE              write the contents of the query buffer, raw
                                    (non-interpolated) buffer, or exec buffer to file
  \write                            alias for \w
  \r                                reset (clear) the query buffer
  \reset                            alias for \r

Informational
  \d[S+] [NAME]                     list tables, views, and sequences or describe table, view,
                                    sequence, or index
  \da[S+] [PATTERN]                 list aggregates
  \df[S+] [PATTERN]                 list functions
  \di[S+] [PATTERN]                 list indexes
  \dm[S+] [PATTERN]                 list materialized views
  \dn[S+] [PATTERN]                 list schemas
  \dp[S] [PATTERN]                  list table, view, and sequence access privileges
  \ds[S+] [PATTERN]                 list sequences
  \dt[S+] [PATTERN]                 list tables
  \dv[S+] [PATTERN]                 list views
  \l[+]                             list databases
  \ss[+] [TABLE|QUERY] [k]          show stats for a table or a query

Variables
  \set [NAME [VALUE]]               set usql application variable, or show all usql application
                                    variables if no parameters
  \unset NAME                       unset (delete) usql application variable
  \pset [NAME [VALUE]]              set table print formatting option, or show all print
                                    formatting options if no parameters
  \a                                toggle between unaligned and aligned output mode
  \C [TITLE]                        set table title, or unset if none
  \f [SEPARATOR]                    show or set field separator for unaligned query output
  \H                                toggle HTML output mode
  \T [ATTRIBUTES]                   set HTML <table> tag attributes, or unset if none
  \t [on|off]                       show only rows
  \x [on|off|auto]                  toggle expanded output
  \cset [NAME [URL]]                set named connection, or show all named connections if no
                                    parameters
  \cset NAME DRIVER PARAMS...       set named connection for driver and parameters
  \prompt [-TYPE] VAR [PROMPT]      prompt user to set application variable

Input/Output
  \echo [-n] [MESSAGE]...           write message to standard output (-n for no newline)
  \qecho [-n] [MESSAGE]...          write message to \o output stream (-n for no newline)
  \warn [-n] [MESSAGE]...           write message to standard error (-n for no newline)
  \o [FILE]                         send all query results to file or |pipe
  \out                              alias for \o
  \copy SRC DST QUERY TABLE         copy results of query from source database into table on
                                    destination database
  \copy SRC DST QUERY TABLE(A,...)  copy results of query from source database into table's
                                    columns on destination database

Control/Conditional
  \i FILE                           execute commands from file
  \include                          alias for \i
  \ir FILE                          as \i, but relative to location of current script
  \include_relative                 alias for \ir
  \if EXPR                          begin conditional block
  \elif EXPR                        alternative within current conditional block
  \else                             final alternative within current conditional block
  \endif                            end conditional block

Transaction
  \begin [-read-only [ISOLATION]]   begin transaction, with optional isolation level
  \commit                           commit current transaction
  \rollback                         rollback (abort) current transaction
  \abort                            alias for \rollback

Operating System/Environment
  \! [COMMAND]                      execute command in shell or start interactive shell
  \cd [DIR]                         change the current working directory
  \getenv VARNAME ENVVAR            fetch environment variable
  \setenv NAME [VALUE]              set or unset environment variable
```

Parameters passed to commands [can be backticked][backticks].

## Features and Compatibility

An overview of `usql`'s features, functionality, and compatibility with `psql`:

- [Configuration][config]
- [Variables][variables]
- [Backticks][backticks]
- [Copying Between Databases][copying]
- [Syntax Highlighting][highlighting]
- [Time Formatting][timefmt]
- [Context Completion][completion]
- [Host Connection Information](#host-connection-information)
- [Passwords][usqlpass]
- [Runtime Configuration (RC) File][usqlrc]

The `usql` project's goal is to support as much of `psql`'s core features and
functionality, and aims to be as compatible as possible - [contributions are
always appreciated][contributing]!

#### Configuration

During its initialization phase, `usql` reads a standard [YAML configuration][yaml]
file [`config.yaml`](contrib/config.yaml). On Windows this is `%AppData%/usql/config.yaml`,
on macOS this is `$HOME/Library/Application Support/usql/config.yaml`, and on
Linux and other Unix systems this is normally `$HOME/.config/usql/config.yaml`.

##### `connections:`

[Named connection DSNs][connecting] can be defined under `connections:` as a string
or as a map:

```yaml
connections:
  my_couchbase_conn: couchbase://Administrator:P4ssw0rd@localhost
  my_clickhouse_conn: clickhouse://clickhouse:P4ssw0rd@localhost
  my_godror_conn:
    protocol: godror
    username: system
    password: P4ssw0rd
    hostname: localhost
    port: 1521
    database: free
```

Defined `connections:` can be used on the command-line with `\connect`, `\c`,
`\copy`, and [other commands][commands]:

```sh
$ usql my_godror_conn
Connected with driver godror (Oracle Database 23.0.0.0.0)
Type "help" for help.

gr:system@localhost/free=>
```

##### `init:`

An initialization script can be defined as `init:` as a string:

```yaml
init: |
  \echo welcome to the jungle `date`
  \set SYNTAX_HL_STYLE paraiso-dark
  \set PROMPT1 '\033[32m%S%M%/%R%#\033[0m '
```

The `init:` script is commonly used to set [environment variables][variables]
or other configuration, and can be disabled on the command-line using the
`--no-init` / `-X` flag. The script will be executed prior to any `-c` /
`--command` / `-f` / `--file` flag and before starting the interactive
interpreter.

##### Other Options

Please see [`contrib/config.yaml`](contrib/config.yaml) for an overview of
available configuration options.

#### Variables

`usql` supports [runtime][runtime-vars], [connection][connection-vars], and
[display formatting][print-vars] variables that can be `\set`, `\cset`, or
`\pset` respectively.

##### Runtime Variables

Runtime variables are managed with the `\set` and `\unset` [commands][commands]:

```sh
(not connected)=> \unset FOO
(not connected)=> \set FOO bar
```

Runtime variables can be displayed with `\set`:

```sh
(not connected)=> \set
FOO = 'bar'
```

###### Variable Interpolation

When a runtime variable `NAME` has been `\set`, then `:NAME`, `:'NAME'`, and
`:"NAME"` will be interpolated into the query buffer:

```sh
pg:booktest@localhost=> \set FOO bar
pg:booktest@localhost=> select * from authors where name = :'FOO';
  author_id | name
+-----------+------+
          7 | bar
(1 rows)
```

Where a runtime variable is used as `:'NAME'` or `:"NAME"` the interpolated
value will be quoted using `'` or `"` respectively:

```sh
pg:booktest@localhost=> \set TBLNAME authors
pg:booktest@localhost=> \set COLNAME name
pg:booktest@localhost=> \set FOO bar
pg:booktest@localhost=> select * from :TBLNAME where :"COLNAME" = :'FOO'
```

The query buffer and interpolated values can be displayed with `\p` and
`\print`, or the raw query buffer can be displayed with `\raw`:

```sh
pg:booktest@localhost-> \p
select * from authors where "name" = 'bar'
pg:booktest@localhost-> \raw
select * from :TBLNAME where :"COLNAME" = :'FOO'
```

<hr/>

> **Note**
>
> Variables contained within other strings <b><u>will not</b></u> be interpolated:

```sh
pg:booktest@localhost=> select ':FOO';
  ?column?
+----------+
  :FOO
(1 rows)

pg:booktest@localhost=> \p
select ':FOO';
```

<hr/>

##### Connection Variables

Connection variables work similarly to runtime variables, and are managed with
`\cset`. Connection variables can be used with the `\c`, `\connect`, `\copy`,
or [other commands][commands]:

```sh
(not connected)=> \cset my_conn postgres://user:pass@localhost
(not connected)=> \c my_conn
Connected with driver postgres (PostgreSQL 16.2 (Debian 16.2-1.pgdg120+2))
pg:postgres@localhost=>
```

Connection variables are not interpolated into queries. See the [configuration
section for information on defining persistent connection variables][config].

Connection variables can be displayed with `\cset`:

```sh
(not connected)=> \cset
my_conn = 'postgres://user:pass@localhost'
```

##### Display Formatting (Print) Variables

Display formatting variables can be set using `\pset` and [other
commands][commands]:

```sh
(not connected)=> \pset time Kitchen
Time display is "Kitchen" ("3:04PM").
(not connected)=> \a
Output format is unaligned.
```

Display formatting variables can be displayed with `\pset`:

```sh
(not connected)=> \pset
time                     Kitchen
```

##### Other Variables

Runtime behavior, such as [enabling or disabling syntax
highlighting][highlighting] can be modified through special variables like
[`SYNTAX_HL`][highlighting].

Use the `\? variables` [command][commands] to display variable help information
and to list special variables recognized by `usql`:

```sh
(not connected)=> \? variables
```

#### Backticks

[Backslash (`\`) meta commands][commands] support backticks on parameters:

```sh
(not connected)=> \echo Welcome `echo $USER` -- 'currently:' "(" `date` ")"
Welcome ken -- currently: ( Wed Jun 13 12:10:27 WIB 2018 )
(not connected)=>
```

Backticked parameters will be passed to the user's `SHELL`, exactly as written,
and can be combined with `\set`:

```sh
pg:booktest@localhost=> \set MYVAR `date`
pg:booktest@localhost=> \set
MYVAR = 'Wed Jun 13 12:17:11 WIB 2018'
pg:booktest@localhost=> \echo :MYVAR
Wed Jun 13 12:17:11 WIB 2018
pg:booktest@localhost=>
```

#### Copying Between Databases

`usql` provides a `\copy` command that reads data from a source database DSN
and writes to a destination database DSN:

```sh
(not connected)=> \cset PGDSN postgres://user:pass@localhost
(not connected)=> \cset MYDSN mysql://user:pass@localhost
(not connected)=> \copy PGDSN MYDSN 'select book_id, author_id from books' 'books(id, author_id)'
```

As demonstrated above, the `\copy` command does not require being connected to
a database, and will not modify or change the current open database connection
or state.

Any valid URL or DSN name maybe used for the source and destination database:

```sh
(not connected)=> \cset MYDSN mysql://user:pass@localhost
(not connected)=> \copy postgres://user:pass@localhost MYDSN 'select book_id, author_id from books' 'books(id, author_id)'
```

<hr/>

> **Note**
>
> `usql`'s `\copy` is distinct from and <b><u>does not</u></b> function like
> `psql`'s `\copy`.

<hr/>

##### Copy Parameters

The `\copy` command has two parameter forms:

```txt
\copy SRC DST QUERY TABLE
\copy SRC DST QUERY TABLE(COL1, COL2, ..., COLN)
```

Where:

- `SRC` - is the [source database URL][connecting] to connect to, and where the
  `QUERY` will be executed
- `DST` - is the [destination database URL][connecting] to connect to, and where
  the destination `TABLE` resides
- `QUERY` - is the query to execute on the `SRC` connection, the results of which
  will be copied to `TABLE`
- `TABLE` - is the destination table name, followed by an optional SQL-like column
  list of the form `(COL1, COL2, ..., COLN)`
- `(COL1, COL2, ..., COLN)` - a list of the destination column names, 1-to-N

The usual rules for [variables, interpolation, and quoting][variables] apply to
`\copy`'s parameters.

###### Quoting

`QUERY` and `TABLE` **_must_** be quoted when containing spaces:

```sh
$ usql
(not connected)=> echo :SOURCE_DSN :DESTINATION_DSN
pg://postgres:P4ssw0rd@localhost/ mysql://localhost
(not connected)=> \copy :SOURCE_DSN :DESTINATION_DSN 'select * from mySourceTable' 'myDestination(colA, colB)'
COPY 2
```

###### Column Counts

The `QUERY` **_must_** return the same number of columns as defined by
the `TABLE` expression:

```sh
$ usql
(not connected)=> \copy csvq:. sq:test.db 'select * from authors' authors
error: failed to prepare insert query: 2 values for 1 columns
(not connected)=> \copy csvq:. sq:test.db 'select name from authors' authors(name)
COPY 2
```

###### Datatype Compatibility and Casting

The `\copy` command does not attempt to perform any kind of datatype
conversion.

If a `QUERY` returns columns with different datatypes than expected by the
`TABLE`'s column, the `QUERY` can use the source database's conversion/casting
functionality to cast columns to a datatype that will work for `TABLE`'s
columns:

```sh
$ usql
(not connected)=> \copy postgres://user:pass@localhost mysql://user:pass@localhost 'SELECT uuid_column::TEXT FROM myPgTable' myMyTable
COPY 1
```

###### Importing Data from CSV

The `\copy` command is capable of importing data from CSV's (or any other
database!) using the `csvq` driver:

```sh
$ cat authors.csv
author_id,name
1,Isaac Asimov
2,Stephen King
$ cat books.csv
book_id,author_id,title
1,1,I Robot
2,2,Carrie
3,2,Cujo
$ usql
(not connected)=> -- setting variables to make connections easier
(not connected)=> \set SOURCE_DSN csvq://.
(not connected)=> \set DESTINATION_DSN sqlite3:booktest.db
(not connected)=> -- connecting to the destination and creating the schema
(not connected)=> \c :DESTINATION_DSN
Connected with driver sqlite3 (SQLite3 3.38.5)
(sq:booktest.db)=> create table authors (author_id integer, name text);
CREATE TABLE
(sq:booktest.db)=> create table books (book_id integer not null primary key autoincrement, author_id integer, title text);
CREATE TABLE
(sq:booktest.db)=> -- adding an extra row to books prior to copying
(sq:booktest.db)=> insert into books (author_id, title) values (1, 'Foundation');
INSERT 1
(sq:booktest.db)=> -- disconnecting to demonstrate that \copy opens new database connections
(sq:booktest.db)=> \disconnect
(not connected)=> -- copying data from SOURCE -> DESTINATION
(not connected)=> \copy :SOURCE_DSN :DESTINATION_DSN 'select * from authors' authors
COPY 2
(not connected)=> \copy :SOURCE_DSN :DESTINATION_DSN 'select author_id, title from books' 'books(author_id, title)'
COPY 3
(not connected)=> \c :DESTINATION_DSN
Connected with driver sqlite3 (SQLite3 3.38.5)
(sq:booktest.db)=> select * from authors;
 author_id |     name
-----------+--------------
         1 | Isaac Asimov
         2 | Stephen King
(2 rows)

sq:booktest.db=> select * from books;
 book_id | author_id |   title
---------+-----------+------------
       1 |         1 | Foundation
       2 |         1 | I Robot
       3 |         2 | Carrie
       4 |         2 | Cujo
(4 rows)
```

<hr/>

> **Note**
>
> When importing large datasets (> 1GiB) from one database to another, it is
> better to use a database's native clients and tools.

<hr/>

###### Reusing Connections with Copy

The `\copy` command (and all `usql` commands) [works with variables][variables].
When scripting, or when needing to perform multiple `\copy` operations from/to
multiple sources/destinations, the best practice is to `\set` connection
variables either in a script or in [the `$HOME/.usqlrc` RC script][usqlrc].

Similarly, passwords can be stored for easy reuse (and kept out of scripts) by
storing in [the `$HOME/.usqlpass` password file][usqlpass].

For example:

```sh
$ cat $HOME/.usqlpass
postgres:*:*:*:postgres:P4ssw0rd
godror:*:*:*:system:P4ssw0rd
$ usql
Type "help" for help.

(not connected)=> \set pglocal postgres://postgres@localhost:49153?sslmode=disable
(not connected)=> \set orlocal godror://system@localhost:1521/orasid
(not connected)=> \copy :pglocal :orlocal 'select staff_id, first_name from staff' 'staff(staff_id, first_name)'
COPY 18
```

#### Syntax Highlighting

Interactive queries will be syntax highlighted by default, using
[Chroma][chroma]. There are a number of [variables][] that control syntax
highlighting:

| Variable                | Default                         | Values            | Description                                                  |
| ----------------------- | ------------------------------- | ----------------- | ------------------------------------------------------------ |
| `SYNTAX_HL`             | `true`                          | `true` or `false` | enables syntax highlighting                                  |
| `SYNTAX_HL_FORMAT`      | _dependent on terminal support_ | formatter name    | [Chroma formatter name][chroma-formatter]                    |
| `SYNTAX_HL_OVERRIDE_BG` | `true`                          | `true` or `false` | enables overriding the background color of the chroma styles |
| `SYNTAX_HL_STYLE`       | `monokai`                       | style name        | [Chroma style name][chroma-style]                            |

The `SYNTAX_*` variables are regular `usql` variables, and can be `\set` and
`\unset`:

```sh
$ usql
(not connected)=> \set SYNTAX_HL_STYLE dracula
(not connected)=> \unset SYNTAX_HL_OVERRIDE_BG
```

#### Context Completion

When using the interactive shell, context completion is available in `usql` by
hitting the `<Tab>` key. For example, hitting `<Tab>` can complete some parts
of `SELECT` queries on a PostgreSQL databases:

```sh
$ usql
Connected with driver postgres (PostgreSQL 14.4 (Debian 14.4-1.pgdg110+1))
Type "help" for help.

pg:postgres@=> select * f<Tab>
fetch            from             full outer join
```

Or, for example completing [backslash commands][commands] while connected to a
database:

```sh
$ usql my://
Connected with driver mysql (10.8.3-MariaDB-1:10.8.3+maria~jammy)
Type "help" for help.

my:root@=> \g<Tab>
\g     \gexec \gset  \gx
```

Not all commands, contexts, or databases support completion. If you're
interested in helping to make `usql`'s completion better, see [the section
below on contributing][contributing].

Command completion can be canceled with `<Control-C>`.

#### Time Formatting

Some databases support time/date columns that [support formatting][go-time]. By
default, `usql` formats time/date columns as [RFC3339Nano][go-time], and can be
set using `\pset time FORMAT`:

```sh
$ usql pg://
Connected with driver postgres (PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1))
Type "help" for help.

pg:postgres@=> \pset
time                     RFC3339Nano
pg:postgres@=> select now();
             now
-----------------------------
 2021-05-01T22:21:44.710385Z
(1 row)

pg:postgres@=> \pset time Kitchen
Time display is "Kitchen" ("3:04PM").
pg:postgres@=> select now();
   now
---------
 10:22PM
(1 row)

pg:postgres@=>
```

`usql`'s time format supports any [Go supported time format][go-time], or can
be any standard Go const name, such as `Kitchen` above. See below for an
overview of the [available time constants](#time-constants).

##### Time Constants

The following are the time constant names available in `usql`, corresponding
time format value, and example display output:

| Constant    |                                Format |        Display <sup>[↓][f-ts]</sup> |
| ----------- | ------------------------------------: | ----------------------------------: |
| ANSIC       |            `Mon Jan _2 15:04:05 2006` |          `Wed Aug  3 20:12:48 2022` |
| UnixDate    |        `Mon Jan _2 15:04:05 MST 2006` |      `Wed Aug  3 20:12:48 UTC 2022` |
| RubyDate    |      `Mon Jan 02 15:04:05 -0700 2006` |    `Wed Aug 03 20:12:48 +0000 2022` |
| RFC822      |                 `02 Jan 06 15:04 MST` |               `03 Aug 22 20:12 UTC` |
| RFC822Z     |               `02 Jan 06 15:04 -0700` |             `03 Aug 22 20:12 +0000` |
| RFC850      |      `Monday, 02-Jan-06 15:04:05 MST` | `Wednesday, 03-Aug-22 20:12:48 UTC` |
| RFC1123     |       `Mon, 02 Jan 2006 15:04:05 MST` |     `Wed, 03 Aug 2022 20:12:48 UTC` |
| RFC1123Z    |     `Mon, 02 Jan 2006 15:04:05 -0700` |   `Wed, 03 Aug 2022 20:12:48 +0000` |
| RFC3339     |           `2006-01-02T15:04:05Z07:00` |              `2022-08-03T20:12:48Z` |
| RFC3339Nano | `2006-01-02T15:04:05.999999999Z07:00` |       `2022-08-03T20:12:48.693257Z` |
| Kitchen     |                              `3:04PM` |                            `8:12PM` |
| Stamp       |                     `Jan _2 15:04:05` |                   `Aug  3 20:12:48` |
| StampMilli  |                 `Jan _2 15:04:05.000` |               `Aug  3 20:12:48.693` |
| StampMicro  |              `Jan _2 15:04:05.000000` |            `Aug  3 20:12:48.693257` |
| StampNano   |           `Jan _2 15:04:05.000000000` |         `Aug  3 20:12:48.693257000` |

[f-ts]: #f-ts "Timestamp Value"

<p>
  <i>
    <a id="f-ts"><sup>↓</sup> Generated using timestamp <code>2022-08-03T20:12:48.693257Z</code></a><br>
  </i>
</p>

#### Host Connection Information

By default, `usql` displays connection information when connecting to a
database. This might cause problems with some databases or connections. This
can be disabled by setting the system environment variable `USQL_SHOW_HOST_INFORMATION`
to `false`:

```sh
$ export USQL_SHOW_HOST_INFORMATION=false
$ usql pg://booktest@localhost
Type "help" for help.

pg:booktest@=>
```

`SHOW_HOST_INFORMATION` is a standard [`usql` variable][variables],
and can be `\set` or `\unset`. Additionally, it can be passed via the
command-line using `-v` or `--set`:

```sh
$ usql --set SHOW_HOST_INFORMATION=false pg://
Type "help" for help.

pg:booktest@=> \set SHOW_HOST_INFORMATION true
pg:booktest@=> \connect pg://
Connected with driver postgres (PostgreSQL 9.6.9)
pg:booktest@=>
```

#### Terminal Graphics

`usql` supports terminal graphics for [Kitty][kitty-graphics], [iTerm][iterm-graphics],
and [Sixel][sixel-graphics] enabled terminals using the [`github.com/kenshaw/rasterm` package][rasterm].
Terminal graphics are only available when using the interactive shell.

##### Detection and Support

`usql` will attempt to detect when terminal graphics support is available using
the `USQL_TERM_GRAPHICS`, `TERM_GRAPHICS` and other environment variables
unique to various terminals.

When support is available, the logo will be displayed at the start of an
interactive session:

<div style="padding-left: 20px;">
  <img src="https://raw.githubusercontent.com/xo/usql-logo/master/usql-interactive.png" height="120">
</div>

##### Charts and Graphs

The [`\chart` command][chart-command] can be used to display a chart
directly in the terminal:

<div style="padding-left: 20px;">
  <img src="https://raw.githubusercontent.com/xo/usql-logo/master/chart-example.png" height="120">
</div>

See [the section on the `\chart` meta command][chart-command] for details.

##### Enabling/Disabling Terminal Graphics

Terminal graphics can be forced enabled or disabled by setting the
`USQL_TERM_GRAPHICS` or the `TERM_GRAPHICS` environment variable:

```sh
# disable
$ USQL_TERM_GRAPHICS=none usql

# force iterm graphics
$ TERM_GRAPHICS=iterm usql
```

| Variable        | Default | Values                                | Description                    |
| --------------- | ------- | ------------------------------------- | ------------------------------ |
| `TERM_GRAPHICS` | ``      | ``, `kitty`, `iterm`, `sixel`, `none` | enables/disables term graphics |

##### Terminals with Graphics Support

The following terminals have been tested with `usql`:

- [WezTerm][wezterm] is a cross-platform terminal for Windows, macOS, Linux, and
  many other platforms that supports [iTerm][iterm-graphics] graphics

- [iTerm2][iterm2] is a macOS terminal that supports [iTerm][iterm-graphics]
  graphics

- [kitty][kitty] is a terminal for Linux, macOS, and various BSDs that supports
  [Kitty][kitty-graphics] graphics

- [foot][foot] is a Wayland terminal for Linux (and other Wayland hosts) that
  supports [Sixel][sixel-graphics] graphics

Additional terminals that support [Sixel][sixel-graphics] graphics are
catalogued on the [Are We Sixel Yet?][arewesixelyet] website.

#### Passwords

`usql` supports reading passwords for databases from a `.usqlpass` file
contained in the user's `HOME` directory at startup:

```sh
$ cat $HOME/.usqlpass
# format is:
# protocol:host:port:dbname:user:pass
postgres:*:*:*:booktest:booktest
$ usql pg://
Connected with driver postgres (PostgreSQL 9.6.9)
Type "help" for help.

pg:booktest@=>
```

While the `.usqlpass` functionality will not be removed, it is recommended to
[define named connections][connection-vars] preferably via [the `config.yaml`
file][config].

<hr/>

> **Note**
>
> The `.usqlpass` file cannot be readable by other users, and the permissions
> should be set accordingly:

```sh
chmod 0600 ~/.usqlpass
```

<hr/>

#### Runtime Configuration (RC) File

`usql` supports executing a `.usqlrc` runtime configuration (RC) file contained
in the user's `HOME` directory:

```sh
$ cat $HOME/.usqlrc
\echo WELCOME TO THE JUNGLE `date`
\set SYNTAX_HL_STYLE paraiso-dark

-- set color prompt (default is prompt is "%S%m%/%R%#" )
\set PROMPT1 "\033[32m%S%m%/%R%#\033[0m"
$ usql
WELCOME TO THE JUNGLE Thu Jun 14 02:36:53 WIB 2018
Type "help" for help.

(not connected)=> \set
SYNTAX_HL_STYLE = 'paraiso-dark'
(not connected)=>
```

The `.usqlrc` file is read at startup in the same way as a file passed on the
command-line with `-f` / `--file`. It is commonly used to set startup
environment variables and settings.

RC-file execution can be temporarily disabled at startup by passing `-X` or
`--no-init` on the command-line:

```sh
$ usql --no-init pg://
```

While the `.usqlrc` functionality will not be removed, it is recommended to set
an `init` script in [the `config.yaml` file][config].

## Additional Notes

The following are additional notes and miscellania related to `usql`:

### Release Builds

[Release builds][releases] are built with the `most` build tag and with
additional [SQLite3 build tags (see: `build.sh`)](build.sh).

### macOS

The recommended installation method on macOS is [via `brew`][via Homebrew] due
to the way library dependencies for the `sqlite3` driver are done on macOS. If
the following (or similar) error is encountered when attempting to run `usql`:

```sh
$ usql
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicuuc.68.dylib
  Referenced from: /Users/user/.local/bin/usql
  Reason: image not found
Abort trap: 6
```

Then missing library dependency can be fixed by installing
[`icu4c`](http://site.icu-project.org) using `brew`:

```sh
$ brew install icu4c
Running `brew update --auto-update`...
==> Downloading ...
...

$ usql
(not connected)=>
```

## Contributing

`usql` is currently a WIP, and is aiming towards a 1.0 release soon.
Well-written PRs are always welcome -- and there is a clear backlog of issues
marked `help wanted` on the GitHub issue tracker! For [technical details on
contributing, see CONTRIBUTING.md](CONTRIBUTING.md).

[_Pick up an issue today, and submit a PR tomorrow!_][help-wanted]

## Related Projects

- [dburl][dburl] - Go package providing a standard, URL-style mechanism for parsing
  and opening database connection URLs
- [xo][xo] - Go command-line tool to generate Go code from a database schema

[dburl]: https://github.com/xo/dburl
[dburl-schemes]: https://github.com/xo/dburl#protocol-schemes-and-aliases
[go-time]: https://pkg.go.dev/time#pkg-constants
[go-sql]: https://pkg.go.dev/database/sql
[homebrew]: https://brew.sh/
[xo]: https://github.com/xo/xo
[xo-tap]: https://github.com/xo/homebrew-xo
[chroma]: https://github.com/alecthomas/chroma
[chroma-formatter]: https://github.com/alecthomas/chroma#formatters
[chroma-style]: https://xyproto.github.io/splash/docs/all.html
[help-wanted]: https://github.com/xo/usql/issues?q=is:open+is:issue+label:%22help+wanted%22
[aur]: https://aur.archlinux.org/packages/usql
[yay]: https://github.com/Jguer/yay
[arch-makepkg]: https://wiki.archlinux.org/title/makepkg
[backticks]: #backticks "Backticks"
[config]: #configuration "Configuration"
[commands]: #backslash-commands "Backslash Commands"
[completion]: #context-completion "Context Completion"
[connecting]: #connecting-to-databases "Connecting to Databases"
[contributing]: #contributing "Contributing"
[copying]: #copying-between-databases "Copying Between Databases"
[highlighting]: #syntax-highlighting "Syntax Highlighting"
[termgraphics]: #terminal-graphics "Terminal Graphics"
[timefmt]: #time-formatting "Time Formatting"
[usqlpass]: #passwords "Passwords"
[usqlrc]: #runtime-configuration-rc-file "Runtime Configuration File"
[variables]: #variables "Variables"
[runtime-vars]: #runtime-variables "Runtime Variables"
[connection-vars]: #connection-variables "Connection Variables"
[print-vars]: #display-formatting-(print)-variables "Display Formatting (print) Variables"
[kitty-graphics]: https://sw.kovidgoyal.net/kitty/graphics-protocol.html
[iterm-graphics]: https://iterm2.com/documentation-images.html
[sixel-graphics]: https://saitoha.github.io/libsixel/
[rasterm]: https://github.com/kenshaw/rasterm
[wezterm]: https://wezfurlong.org/wezterm/
[iterm2]: https://iterm2.com
[foot]: https://codeberg.org/dnkl/foot
[kitty]: https://sw.kovidgoyal.net/kitty/
[arewesixelyet]: https://www.arewesixelyet.com
[chart-command]: #chart-command "\\chart meta command"
[yaml]: https://yaml.org


================================================
FILE: build.sh
================================================
#!/bin/bash

set -e

SRC=$(realpath $(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd))

NAME=$(basename $SRC)
VER=
STATIC=0
FORCE=0
CHECK=1
INSTALL=0
BUILDONLY=0
VERBOSE=false
CGO_ENABLED=1
LDNAME=github.com/xo/usql/text.CommandName
LDVERSION=github.com/xo/usql/text.CommandVersion
PLATFORM=$(go env GOOS)
ARCH=$(go env GOARCH)
GOARCH=$ARCH

TAGS=(
  most
  sqlite_app_armor
  sqlite_fts5
  sqlite_introspect
  sqlite_json1
  sqlite_math_functions
  sqlite_stat4
  sqlite_vtable
)

latest_tag() {
  # get latest tag version
  pushd $SRC &> /dev/null
  git tag -l|grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$'|sort -r -V|head -1||:
  popd &> /dev/null
}

OPTIND=1
while getopts "a:v:sfnibxt:r" opt; do
case "$opt" in
  a) ARCH=$OPTARG ;;
  v) VER=$OPTARG ;;
  s) STATIC=1 ;;
  f) FORCE=1 ;;
  n) CHECK=0 ;;
  i) INSTALL=1 ;;
  b) BUILDONLY=1 ;;
  x) VERBOSE=true ;;
  t) TAGS=($OPTARG) ;;
  r) VER=$(latest_tag) ;;
esac
done

# neither -v or -r specified, or -v=master, set FORCE and VER
if [[ "$VER" = "" || "$VER" == "master" ]]; then
  VER=0.0.0-dev
  FORCE=1
fi

VER="${VER#v}"

BUILD=$SRC/build
DIR=$BUILD/$PLATFORM/$ARCH/$VER

TAR=tar
EXT=tar.bz2
BIN=$DIR/$NAME

case $PLATFORM in
  linux)
    TAGS+=(no_adodb)
  ;;
  windows)
    EXT=zip
    BIN=$BIN.exe
  ;;
  darwin)
    TAGS+=(no_adodb)
    TAR=gtar
  ;;
esac
OUT=$DIR/$NAME-$VER-$PLATFORM-$ARCH.$EXT

CARCH=
QEMUARCH=
GNUTYPE=
CC=
CXX=
EXTLD=g++

if [[ "$PLATFORM" == "linux" && "$ARCH" != "$GOARCH" ]]; then
  case $ARCH in
    arm)   CARCH=armhf   QEMUARCH=arm     GNUTYPE=gnueabihf ;;
    arm64) CARCH=aarch64 QEMUARCH=aarch64 GNUTYPE=gnu ;;
    *)
      echo "error: unknown arch $ARCH"
      exit 1
    ;;
  esac
  LDARCH=$CARCH
  if [[ "$ARCH" == "arm" ]]; then
    TAGS+=(no_netezza no_chai)
    if [ -d /usr/arm-linux-$GNUTYPE ]; then
      LDARCH=arm
    elif [ -d /usr/arm-none-linux-$GNUTYPE ]; then
      LDARCH=arm-none
    fi
  fi
  CC=$LDARCH-linux-$GNUTYPE-gcc
  CXX=$LDARCH-linux-$GNUTYPE-c++
  EXTLD=$LDARCH-linux-$GNUTYPE-g++
fi

if [[ "$PLATFORM" == "linux" && "$ARCH" != "amd64" ]] || [[ "$PLATFORM" == "windows" ]]; then
  TAGS+=(no_duckdb)
fi

LDFLAGS=(
  -s
  -w
  -X $LDNAME=$NAME
  -X $LDVERSION=$VER
)

if [ "$STATIC" = "1" ]; then
  OUT=$DIR/${NAME}_static-$VER-$PLATFORM-$ARCH.$EXT
  BIN=$DIR/${NAME}_static
  case $PLATFORM in
    linux)
      TAGS+=(
        netgo
        osusergo
        minicore_disabled
      )
      EXTLDFLAGS=(
        -static
        -lm
        -ldl
      )
      EXTLDFLAGS="${EXTLDFLAGS[@]}"
      LDFLAGS+=(
        -linkmode=external
        -extldflags \'$EXTLDFLAGS\'
        -extld $EXTLD
      )
    ;;
    *)
      echo "ERROR: fully static builds not currently supported for $PLATFORM/$ARCH"
      exit 1
    ;;
  esac
fi

# check not overwriting existing build artifacts
if [[ -e $OUT && "$FORCE" != "1" && "$INSTALL" == "0" ]]; then
  echo "ERROR: $OUT exists and FORCE != 1 (try $0 -f)"
  exit 1
fi

TAGS="${TAGS[@]}"
LDFLAGS="${LDFLAGS[@]}"

echo "APP:         $NAME/${VER} ($PLATFORM/$ARCH)"
if [ "$STATIC" = "1" ]; then
  echo "STATIC:      yes"
fi
echo "BUILD TAGS:  $TAGS"
echo "LDFLAGS:     $LDFLAGS"

pushd $SRC &> /dev/null

if [ -f $OUT ]; then
  echo "REMOVING:    $OUT"
  rm -rf $OUT
fi
mkdir -p $DIR
echo "BUILDING:    $BIN"

# build
echo "BUILD:"

VERB=build
OUTPUT="-o $BIN"
if [ "$INSTALL" = "1" ]; then
  VERB=install OUTPUT=""
elif [ "$BUILDONLY" = "1" ]; then
  OUTPUT=""
fi
(set -x;
  CC=$CC \
  CXX=$CXX \
  CGO_ENABLED=$CGO_ENABLED \
  GOARCH=$ARCH \
  go $VERB \
    -v=$VERBOSE \
    -x=$VERBOSE \
    -ldflags="$LDFLAGS" \
    -tags="$TAGS" \
    -trimpath \
    $OUTPUT
)

if [[ "$INSTALL" == "1" || "$BUILDONLY" == "1" ]]; then
  exit
fi

(set -x;
  file $BIN
)
if [[ "$PLATFORM" != "windows" ]]; then
  (set -x;
    chmod +x $BIN
  )
fi

# purge disk cache
if [[ "$PLATFORM" == "darwin" && "$CI" == "true" ]]; then
  (set -x;
    sudo /usr/sbin/purge
  )
fi

built_ver() {
  if [[ "$PLATFORM" == "linux" && "$ARCH" != "$GOARCH" ]]; then
    EXTRA=
    if [ -d /usr/$LDARCH-linux-$GNUTYPE/libc ]; then
      EXTRA="-L /usr/$LDARCH-linux-$GNUTYPE/libc"
    fi
    qemu-$QEMUARCH \
      -L /usr/$LDARCH-linux-$GNUTYPE \
      $EXTRA \
      $BIN --version
  elif [[ "$PLATFORM" == "darwin" && "$ARCH" != "$GOARCH" ]]; then
    echo "$NAME ${VER#v}"
  else
    $BIN --version
  fi
}

# check build
if [[ "$CHECK" == "1" ]]; then
  BUILT_VER=$(built_ver)
  if [ "$BUILT_VER" != "$NAME ${VER#v}" ]; then
    echo -e "\n\nERROR: expected $NAME --version to report '$NAME ${VER#v}', got: '$BUILT_VER'"
    exit 1
  fi
  echo "REPORTED:    $BUILT_VER"
fi

# pack
cp $SRC/LICENSE $DIR
case $EXT in
  tar.bz2) $TAR -C $DIR -cjf $OUT $(basename $BIN) LICENSE ;;
  zip) zip $OUT -j $BIN LICENSE ;;
esac

# report
echo "PACKED:      $OUT ($(du -sh $OUT|awk '{print $1}'))"

case $EXT in
  tar.bz2) (set -x; $TAR  -jvtf $OUT) ;;
  zip)     (set -x; unzip -l    $OUT) ;;
esac

(set -x;
  sha256sum $DIR/*
)

popd &> /dev/null


================================================
FILE: contrib/adodb/adodb.sh
================================================
#!/bin/bash

rm -f example.csv

usql "adodb://Microsoft.ACE.OLEDB.12.0/?Extended+Properties=\"Text;HDR=NO;FMT=Delimited\"" \
  -c "create table example.csv(f1 text, f2 text, f3 text);" \
  -c "insert into example.csv(f1, f2, f3) values ('a', 'b', 'c');" \
  -c "select * from example.csv;"


================================================
FILE: contrib/adodb/usql-config
================================================


================================================
FILE: contrib/cassandra/podman-config
================================================
NAME=cassandra
IMAGE=docker.io/usql/cassandra
PUBLISH=9042:9042


================================================
FILE: contrib/cassandra/test.sql
================================================
USE cycling;
CREATE KEYSPACE IF NOT EXISTS cycling WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };

// Q1:
-- Find a cyclist's name given an ID number
// CREATE TABLE SIMPLE PRIMARY KEY
CREATE TABLE cycling.cyclist_name ( id UUID PRIMARY KEY, lastname text, firstname text );
INSERT INTO cycling.cyclist_name (id, lastname, firstname) VALUES (5b6962dd-3f90-4c93-8f61-eabfa4a803e2, 'VOS','Marianne');
INSERT INTO cycling.cyclist_name (id, lastname, firstname) VALUES (e7cd5752-bc0d-4157-a80f-7523add8dbcd, 'VAN DER BREGGEN','Anna');
INSERT INTO cycling.cyclist_name (id, lastname, firstname) VALUES (e7ae5cf3-d358-4d99-b900-85902fda9bb0, 'FRAME','Alex');
INSERT INTO cycling.cyclist_name (id, lastname, firstname) VALUES (220844bf-4860-49d6-9a4b-6b5d3a79cbfb, 'TIRALONGO','Paolo');
INSERT INTO cycling.cyclist_name (id, lastname, firstname) VALUES (6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47, 'KRUIKSWIJK','Steven');
INSERT INTO cycling.cyclist_name (id, lastname, firstname) VALUES (fb372533-eb95-4bb4-8685-6ef61e994caa, 'MATTHEWS', 'Michael');
SELECT * FROM cycling.cyclist_name;
SELECT lastname, firstname FROM cycling.cyclist_name WHERE id = 6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47;

-- Q2:
-- Find cyclists that fit a particular category
// CREATE TABLE CLUSTERING ORDER, PRIMARY KEY: PARTITION KEY + 1 CLUSTERING COLUMN, SIMPLE WHERE QUERY
CREATE TABLE cycling.cyclist_category ( category text, points int, id UUID, lastname text, PRIMARY KEY (category, points)) WITH CLUSTERING ORDER BY (points DESC);
INSERT INTO cycling.cyclist_category (category, points, id, lastname) VALUES ('GC',1269,220844bf-4860-49d6-9a4b-6b5d3a79cbfb,'TIRALONGO');
INSERT INTO cycling.cyclist_category (category, points, id, lastname) VALUES ('One-day-races',367,220844bf-4860-49d6-9a4b-6b5d3a79cbfb,'TIRALONGO');
INSERT INTO cycling.cyclist_category (category, points, id, lastname) VALUES ('Time-trial',182,220844bf-4860-49d6-9a4b-6b5d3a79cbfb,'TIRALONGO');
INSERT INTO cycling.cyclist_category (category, points, id, lastname) VALUES ('Sprint',0,220844bf-4860-49d6-9a4b-6b5d3a79cbfb,'TIRALONGO');
INSERT INTO cycling.cyclist_category (category, points, id, lastname) VALUES ('GC',1324,6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47,'KRUIJSWIJK');
INSERT INTO cycling.cyclist_category (category, points, id, lastname) VALUES ('One-day-races',198,6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47,'KRUIJSWIJK');
INSERT INTO cycling.cyclist_category (category, points, id, lastname) VALUES ('Sprint',39,6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47,'KRUIJSWIJK');
INSERT INTO cycling.cyclist_category (category, points, id, lastname) VALUES ('Time-trial',3,6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47,'KRUIJSWIJK');
SELECT * FROM cycling.cyclist_category;
SELECT lastname, points FROM cycling.cyclist_category WHERE category = 'One-day-races';

-- Q3:
-- Store race information by year and race name using a COMPOSITE PARTITION KEY
CREATE TABLE cycling.rank_by_year_and_name ( race_year int, race_name text, cyclist_name text, rank int, PRIMARY KEY ((race_year, race_name), rank) );
INSERT INTO cycling.rank_by_year_and_name (race_year, race_name, cyclist_name, rank) VALUES (2015, 'Tour of Japan - Stage 4 - Minami > Shinshu', 'Benjamin PRADES', 1);
INSERT INTO cycling.rank_by_year_and_name (race_year, race_name, cyclist_name, rank) VALUES (2015, 'Tour of Japan - Stage 4 - Minami > Shinshu', 'Adam PHELAN', 2);
INSERT INTO cycling.rank_by_year_and_name (race_year, race_name, cyclist_name, rank) VALUES (2015, 'Tour of Japan - Stage 4 - Minami > Shinshu', 'Thomas LEBAS', 3);
INSERT INTO cycling.rank_by_year_and_name (race_year, race_name, cyclist_name, rank) VALUES (2015, 'Giro d''Italia - Stage 11 - Forli > Imola', 'Ilnur ZAKARIN', 1);
INSERT INTO cycling.rank_by_year_and_name (race_year, race_name, cyclist_name, rank) VALUES (2015, 'Giro d''Italia - Stage 11 - Forli > Imola', 'Carlos BETANCUR', 2);
INSERT INTO cycling.rank_by_year_and_name (race_year, race_name, cyclist_name, rank) VALUES (2014, '4th Tour of Beijing', 'Phillippe GILBERT', 1);
INSERT INTO cycling.rank_by_year_and_name (race_year, race_name, cyclist_name, rank) VALUES (2014, '4th Tour of Beijing', 'Daniel MARTIN', 2);
INSERT INTO cycling.rank_by_year_and_name (race_year, race_name, cyclist_name, rank) VALUES (2014, '4th Tour of Beijing', 'Johan Esteban CHAVES', 3);
SELECT * FROM cycling.rank_by_year_and_name;
SELECT * FROM cycling.rank_by_year_and_name WHERE race_year=2015 AND race_name='Tour of Japan - Stage 4 - Minami > Shinshu';

-- New C* 3.6
-- PER PARTITION LIMIT
-- To get the Top Two for each race_year-race_name pair
SELECT * FROM cycling.rank_by_year_and_name PER PARTITION LIMIT 2;

-- Q4:
-- Find a cyclist's id given lastname and firstname
-- Another CREATE TABLE using COMPOSITE PARTITION KEY
-- 2i INDEX ALSO GOOD FOR THIS TABLE
CREATE TABLE cycling.cyclist_id ( lastname text, firstname text, age int, id UUID, PRIMARY KEY ((lastname, firstname), age) );
INSERT INTO cycling.cyclist_id (lastname, firstname, age, id) VALUES ('EENKHOORN','Pascal',18, ffdfa2a7-5fc6-49a7-bfdc-3fcdcfdd7156);
INSERT INTO cycling.cyclist_id (lastname, firstname, age, id) VALUES ('WELTEN','Bram',18, 18f471bf-f631-4bc4-a9a2-d6f6cf5ea503);
INSERT INTO cycling.cyclist_id (lastname, firstname, age, id) VALUES ('COSTA','Adrien',17, 15a116fc-b833-4da6-ab9a-4a7775752836);
SELECT * FROM cycling.cyclist_id WHERE lastname = 'COSTA' AND firstname = 'Adrien';
-- If you want to search by age, an index can be added
CREATE INDEX c_age ON cycling.cyclist_id (age);
SELECT * FROM cycling.cyclist_id WHERE age = 18;

-- Q5:
-- Display flag for riders
-- CREATE TABLE WITH STATIC COLUMN, example uses an integer to identify flag, but it could be a blob
CREATE TABLE cycling.country_flag (country text, cyclist_name text, flag int STATIC, PRIMARY KEY (country, cyclist_name));
INSERT INTO cycling.country_flag (country, cyclist_name, flag) VALUES ('Belgium', 'Jacques', 1);
INSERT INTO cycling.country_flag (country, cyclist_name) VALUES ('Belgium', 'Andre');
INSERT INTO cycling.country_flag (country, cyclist_name, flag) VALUES ('France', 'Andre', 2);
INSERT INTO cycling.country_flag (country, cyclist_name, flag) VALUES ('France', 'George', 3);
-- USE SELECT REPEATEDLY TO SHOW CHANGING (OR UNCHANGING) NATURE OF the column 'flag'
SELECT * FROM cycling.country_flag;

-- Q6:
-- Find all teams that a cyclist has been a member of
--CREATE TABLE WITH SET
CREATE TABLE cycling.cyclist_career_teams ( id UUID PRIMARY KEY, lastname text, teams set<text> );
INSERT INTO cycling.cyclist_career_teams (id,lastname,teams) VALUES (5b6962dd-3f90-4c93-8f61-eabfa4a803e2, 'VOS', { 'Rabobank-Liv Woman Cycling Team','Rabobank-Liv Giant','Rabobank Women Team','Nederland bloeit' } );
INSERT INTO cycling.cyclist_career_teams (id,lastname,teams) VALUES (e7cd5752-bc0d-4157-a80f-7523add8dbcd, 'VAN DER BREGGEN', { 'Rabobank-Liv Woman Cycling Team','Sengers Ladies Cycling Team','Team Flexpoint' } );
INSERT INTO cycling.cyclist_career_teams (id,lastname,teams) VALUES (cb07baad-eac8-4f65-b28a-bddc06a0de23, 'ARMITSTEAD', { 'Boels-Dolmans Cycling Team','AA Drink - Leontien.nl','Team Garmin - Cervelo' } );
INSERT INTO cycling.cyclist_career_teams (id,lastname,teams) VALUES (1c9ebc13-1eab-4ad5-be87-dce433216d40, 'BRAND', { 'Rabobank-Liv Woman Cycling Team','Rabobank-Liv Giant','AA Drink - Leontien.nl','Leontien.nl' } );
SELECT lastname,teams FROM cycling.cyclist_career_teams;
SELECT lastname, teams FROM cycling.cyclist_career_teams WHERE id=5b6962dd-3f90-4c93-8f61-eabfa4a803e2;

-- NOT A QUERY, JUST A TABLE FOR QUERIES
-- CREATE TABLE WITH LIST FOR UPDATE
-- The SELECT statements that use this table can be found below
CREATE TABLE cycling.calendar (race_id int, race_name text, race_start_date timestamp, race_end_date timestamp, PRIMARY KEY (race_id, race_start_date, race_end_date));
INSERT INTO cycling.calendar (race_id, race_name, race_start_date, race_end_date) VALUES (100, 'Giro d''Italia','2015-05-09','2015-05-31');
INSERT INTO cycling.calendar (race_id, race_name, race_start_date, race_end_date) VALUES (101, 'Criterium du Dauphine','2015-06-07','2015-06-14');
INSERT INTO cycling.calendar (race_id, race_name, race_start_date, race_end_date) VALUES (102, 'Tour de Suisse','2015-06-13','2015-06-21');
INSERT INTO cycling.calendar (race_id, race_name, race_start_date, race_end_date) VALUES (103, 'Tour de France','2015-07-04','2015-07-26');
SELECT * FROM cycling.calendar;

-- NEW FOR C*3.6
-- Clustering columns can be used in a WHERE clause with ALLOW FILTERING without secondary indexes
-- This query uses the clustering column "race_start_date" without an index and without using the partition key
-- but using ALLOW FILTERING
SELECT * FROM cycling.calendar WHERE race_start_date='2015-06-13' ALLOW FILTERING;

-- Q7:
-- Find all calendar events for a particular year and month
CREATE TABLE cycling.upcoming_calendar ( year int, month int, events list<text>, PRIMARY KEY ( year, month ));
INSERT INTO cycling.upcoming_calendar (year, month, events) VALUES (2015, 06, ['Criterium du Dauphine','Tour de Suisse']);
INSERT INTO cycling.upcoming_calendar (year, month, events) VALUES (2015, 07, ['Tour de France']);
SELECT * FROM cycling.upcoming_calendar WHERE year=2015 AND month=06;

-- Q8:
-- SIMPLE USER-DEFINED TYPE
CREATE TYPE cycling.fullname ( firstname text, lastname text );
CREATE TABLE cycling.race_winners (race_name text, race_position int, cyclist_name FROZEN<fullname>, PRIMARY KEY (race_name, race_position));
INSERT INTO cycling.race_winners (race_name, race_position, cyclist_name) VALUES ('National Championships South Africa WJ-ITT (CN)', 1, {firstname:'Frances',lastname:'DU TOUT'});
INSERT INTO cycling.race_winners (race_name, race_position, cyclist_name) VALUES ('National Championships South Africa WJ-ITT (CN)', 2, {firstname:'Lynette',lastname:'BENSON'});
INSERT INTO cycling.race_winners (race_name, race_position, cyclist_name) VALUES ('National Championships South Africa WJ-ITT (CN)', 3, {firstname:'Anja',lastname:'GERBER'});
INSERT INTO cycling.race_winners (race_name, race_position, cyclist_name) VALUES ('National Championships South Africa WJ-ITT (CN)', 4, {firstname:'Ame',lastname:'VENTER'});
INSERT INTO cycling.race_winners (race_name, race_position, cyclist_name) VALUES ('National Championships South Africa WJ-ITT (CN)', 5, {firstname:'Danielle',lastname:'VAN NIEKERK'});
SELECT * FROM cycling.race_winners WHERE race_name = 'National Championships South Africa WJ-ITT (CN)';

-- Q9:
-- Find all races for a particular cyclist
-- CREATE TYPE - User-Defined Type, race
-- CREATE TABLE WITH LIST, SIMPLE PRIMARY KEY
CREATE TYPE cycling.race (race_title text, race_date timestamp, race_time text);
CREATE TABLE cycling.cyclist_races ( id UUID PRIMARY KEY, lastname text, firstname text, races list<FROZEN <race>> );
INSERT INTO cycling.cyclist_races (id, lastname, firstname, races) VALUES (5b6962dd-3f90-4c93-8f61-eabfa4a803e2, 'VOS', 'Marianne', [ {race_title:'Rabobank 7-Dorpenomloop Aalburg',race_date:'2015-05-09',race_time:'02:58:33'},{race_title:'Ronde van Gelderland',race_date:'2015-04-19',race_time:'03:22:23'}
]);
INSERT INTO cycling.cyclist_races (id, lastname, firstname, races) VALUES (e7cd5752-bc0d-4157-a80f-7523add8dbcd, 'VAN DER BREGGEN', 'Anna', [ {race_title:'Festival Luxembourgeois du cyclisme feminin Elsy Jacobs - Prologue - Garnich > Garnich',race_date:'2015-05-01',race_time:'08:13:00'},{race_title:'Fest
ival Luxembourgeois du cyclisme feminin Elsy Jacobs - Stage 2 - Garnich > Garnich',race_date:'2015-05-02',race_time:'02:41:52'},{race_title:'Festival Luxembourgeois du cyclisme feminin Elsy Jacobs - Stage 3 - Mamer > Mamer',race_date:'2015-05-03',race_time:'02:31:24'} ]);
SELECT * FROM cycling.cyclist_races;
SELECT lastname, races FROM cycling.cyclist_races WHERE id = e7cd5752-bc0d-4157-a80f-7523add8dbcd;

-- Q10:
-- Find all teams for a particular cyclist associated with the year of membership
-- teams map<int, text> is map<year, team_name>
-- CREATE TABLE WITH MAP, SIMPLE PRIMARY KEY
CREATE TABLE cycling.cyclist_teams ( id UUID PRIMARY KEY, lastname text, firstname text, teams map<int,text> );
INSERT INTO cycling.cyclist_teams (id, lastname, firstname, teams) VALUES (5b6962dd-3f90-4c93-8f61-eabfa4a803e2,'VOS', 'Marianne', {2015 : 'Rabobank-Liv Woman Cycling Team', 2014 : 'Rabobank-Liv Woman Cycling Team', 2013 : 'Rabobank-Liv Giant', 2012 : 'Rabobank Women Team', 2011 : 'Nederland bloeit' });
INSERT INTO cycling.cyclist_teams (id, lastname, firstname, teams) VALUES (e7cd5752-bc0d-4157-a80f-7523add8dbcd,'VAN DER BREGGEN', 'Anna', {2015 : 'Rabobank-Liv Woman Cycling Team', 2014 : 'Rabobank-Liv Woman Cycling Team', 2013 : 'Sengers Ladies Cycling Team', 2012 : 'Sengers Ladies Cycling Team', 2009 : 'Team Flexpoint' });
INSERT INTO cycling.cyclist_teams (id, lastname, firstname, teams) VALUES (cb07baad-eac8-4f65-b28a-bddc06a0de23,'ARMITSTEAD', 'Elizabeth', {2015 : 'Boels-Dolmans Cycling Team', 2014 : 'Boels-Dolmans Cycling Team', 2013 : 'Boels-Dolmans Cycling Team', 2012 : 'AA Drink - Leontien.nl', 2011 : 'Team Garmin - Cervelo' });
SELECT lastname, firstname, teams FROM cycling.cyclist_teams;
SELECT lastname, firstname, teams FROM cycling.cyclist_teams WHERE id=5b6962dd-3f90-4c93-8f61-eabfa4a803e2;

-- Q11:
-- Find all stats for a particular cyclist
-- CREATE TYPE -  UDT, basic_info
-- CREATE TABLE with UDT, SIMPLE PRIMARY KEY
CREATE TYPE cycling.basic_info ( birthday timestamp, nationality text, weight text, height text );
CREATE TABLE cycling.cyclist_stats ( id UUID, lastname text, basics FROZEN <basic_info>, PRIMARY KEY (id) );
INSERT INTO cycling.cyclist_stats (id, lastname, basics) VALUES (e7ae5cf3-d358-4d99-b900-85902fda9bb0, 'FRAME', { birthday:'1993-06-18',nationality:'New Zealand',weight:null,height:null });
INSERT INTO cycling.cyclist_stats (id, lastname, basics) VALUES (6cbc55e9-1943-47dc-91f2-f8f9e95992eb, 'VIGANO', { birthday:'1984-06-12',nationality:'Italy',weight:'67 kg',height:'1.82 m' });
INSERT INTO cycling.cyclist_stats (id, lastname, basics) VALUES (220844bf-4860-49d6-9a4b-6b5d3a79cbfb, 'TIRALONGO', { birthday:'1977-07-08',nationality:'Italy',weight:'63 kg',height:'1.78 m' });
SELECT * FROM cycling.cyclist_stats;
SELECT * FROM cycling.cyclist_stats WHERE id = 220844bf-4860-49d6-9a4b-6b5d3a79cbfb;

-- NEW IN C* 3.6
-- UPDATE AND DELETE single fields in UDTs with only non-collection fields
-- CHANGE "CREATE TABLE IN LAST EXAMPLE TO non-frozen
CREATE TABLE cycling.cyclist_stats ( id UUID, lastname text, basics basic_info, PRIMARY KEY (id) );
-- Now birthday can be updated separate from nationality, weight, and height
UPDATE cycling.cyclist_stats SET basics.birthday = '2000-12-12' WHERE id = 220844bf-4860-49d6-9a4b-6b5d3a79cbfb;

-- Q12:
-- Find total number of PCS points for a particular cyclist
-- CREATE TABLE WITH PRIMARY KEY: PARTITION KEY + 1 CLUSTERING COLUMN
-- USE STANDARD AGGREGATE IN QUERY
CREATE TABLE cycling.cyclist_points (id UUID, firstname text, lastname text, race_title text, race_points int, PRIMARY KEY (id, race_points ));
INSERT INTO cycling.cyclist_points (id, firstname, lastname, race_title, race_points) VALUES (e3b19ec4-774a-4d1c-9e5a-decec1e30aac, 'Giorgia','BRONZINI', 'Tour of Chongming Island World Cup', 120);
INSERT INTO cycling.cyclist_points (id, firstname, lastname, race_title, race_points) VALUES (e3b19ec4-774a-4d1c-9e5a-decec1e30aac, 'Giorgia','BRONZINI', 'Trofeo Alfredo Binda - Comune di Cittiglio', 6);
INSERT INTO cycling.cyclist_points (id, firstname, lastname, race_title, race_points) VALUES (e3b19ec4-774a-4d1c-9e5a-decec1e30aac, 'Giorgia','BRONZINI', 'Acht van Westerveld', 75);
INSERT INTO cycling.cyclist_points (id, firstname, lastname, race_title, race_points) VALUES (220844bf-4860-49d6-9a4b-6b5d3a79cbfb, 'Paolo','TIRALONGO', '98th Giro d''Italia - Stage 15', 2);
SELECT sum(race_points) FROM cycling.cyclist_points WHERE id=e3b19ec4-774a-4d1c-9e5a-decec1e30aac;

-- Q13:
-- USES TABLE cycling.cyclist_points
-- Find total number of PCS points for a particular cyclist using a user-defined function (UDF) created using java function log
-- cassandra.yaml must be modified to allow UDFs to work
-- enable_user_defined_functions: true (false by default)
-- CREATE UDF
CREATE TABLE cycling.cyclist_points (id UUID, firstname text, lastname text, race_title text, race_points double, PRIMARY KEY (id, race_points ));
INSERT INTO cycling.cyclist_points (id, firstname, lastname, race_title, race_points) VALUES (e3b19ec4-774a-4d1c-9e5a-decec1e30aac, 'Giorgia','BRONZINI', 'Tour of Chongming Island World Cup', 120);
INSERT INTO cycling.cyclist_points (id, firstname, lastname, race_title, race_points) VALUES (e3b19ec4-774a-4d1c-9e5a-decec1e30aac, 'Giorgia','BRONZINI', 'Trofeo Alfredo Binda - Comune di Cittiglio', 6);
INSERT INTO cycling.cyclist_points (id, firstname, lastname, race_title, race_points) VALUES (e3b19ec4-774a-4d1c-9e5a-decec1e30aac, 'Giorgia','BRONZINI', 'Acht van Westerveld', 75);
INSERT INTO cycling.cyclist_points (id, firstname, lastname, race_title, race_points) VALUES (220844bf-4860-49d6-9a4b-6b5d3a79cbfb, 'Paolo','TIRALONGO', '98th Giro d''Italia - Stage 15', 2);
CREATE OR REPLACE FUNCTION cycling.fLog (input double) CALLED ON NULL INPUT RETURNS double LANGUAGE java AS 'return Double.valueOf(Math.log(input.doubleValue()));';
SELECT id, lastname, fLog(race_points) FROM cycling.cyclist_points;

-- Q14:
--Find the average race_time in seconds for a particular race for a particular team.
-- CREATE UDA that computes the average value
--CREATE TABLE WITH SIMPLE PRIMARY KEY: PARTITION KEY + 2 CLUSTERING COLUMNS
CREATE OR REPLACE FUNCTION cycling.avgState ( state tuple<int,bigint>, val int ) CALLED ON NULL INPUT RETURNS tuple<int,bigint> LANGUAGE java AS 'if (val !=null) { state.setInt(0, state.getInt(0)+1); state.setLong(1, state.getLong(1)+val.intValue()); } return state;';
CREATE OR REPLACE FUNCTION cycling.avgFinal ( state tuple<int,bigint> ) CALLED ON NULL INPUT RETURNS double LANGUAGE java AS 'double r = 0; if (state.getInt(0) == 0) return null; r = state.getLong(1); r/= state.getInt(0); return Double.valueOf(r);';
CREATE AGGREGATE cycling.average ( int ) SFUNC avgState STYPE tuple<int,bigint> FINALFUNC avgFinal INITCOND (0,0);
CREATE TABLE cycling.team_average (team_name text, cyclist_name text, cyclist_time_sec int, race_title text, PRIMARY KEY (team_name, race_title,cyclist_name));
INSERT INTO cycling.team_average (team_name, cyclist_name, cyclist_time_sec, race_title) VALUES ('UnitedHealthCare Pro Cycling Womens Team','Katie HALL',11449,'Amgen Tour of California Women''s Race presented by SRAM - Stage 1 - Lake Tahoe > Lake Tahoe');
INSERT INTO cycling.team_average (team_name, cyclist_name, cyclist_time_sec, race_title) VALUES ('UnitedHealthCare Pro Cycling Womens Team','Linda VILLUMSEN',11485,'Amgen Tour of California Women''s Race presented by SRAM - Stage 1 - Lake Tahoe > Lake Tahoe');
INSERT INTO cycling.team_average (team_name, cyclist_name, cyclist_time_sec, race_title) VALUES ('UnitedHealthCare Pro Cycling Womens Team','Hannah BARNES',11490,'Amgen Tour of California Women''s Race presented by SRAM - Stage 1 - Lake Tahoe > Lake Tahoe');
INSERT INTO cycling.team_average (team_name, cyclist_name, cyclist_time_sec, race_title) VALUES ('Velocio-SRAM','Alena AMIALIUSIK',11451,'Amgen Tour of California Women''s Race presented by SRAM - Stage 1 - Lake Tahoe > Lake Tahoe');
INSERT INTO cycling.team_average (team_name, cyclist_name, cyclist_time_sec, race_title) VALUES ('Velocio-SRAM','Trixi WORRACK',11453,'Amgen Tour of California Women''s Race presented by SRAM - Stage 1 - Lake Tahoe > Lake Tahoe');
INSERT INTO cycling.team_average (team_name, cyclist_name, cyclist_time_sec, race_title) VALUES ('TWENTY16 presented by Sho-Air','Lauren KOMANSKI',11451,'Amgen Tour of California Women''s Race presented by SRAM - Stage 1 - Lake Tahoe > Lake Tahoe');
SELECT cycling.average(cyclist_time_sec) FROM cycling.team_average WHERE team_name='UnitedHealthCare Pro Cycling Womens Team' AND race_title='Amgen Tour of California Women''s Race presented by SRAM - Stage 1 - Lake Tahoe > Lake Tahoe';

-- Q15:
-- CREATE INDEX - PARTITION KEY
-- Uses cycling.rank_by_year_and_name
-- Find rank for all races for a particular race year
CREATE INDEX ryear ON cycling.rank_by_year_and_name (race_year);
-- This will not work without the index, because the table has a composite partition key
SELECT * FROM cycling.rank_by_year_and_name WHERE race_year=2015;
-- INDEX on clustering column
CREATE INDEX rrank ON cycling.rank_by_year_and_name (rank);
SELECT * FROM cycling.rank_by_year_and_name WHERE rank = 1;

-- Q16:
-- CREATE INDEX - COLLECTION - SET
-- Find all the cyclists that have been on a particular team
CREATE INDEX team ON cycling.cyclist_career_teams (teams);
SELECT * FROM cycling.cyclist_career_teams WHERE teams CONTAINS 'Nederland bloeit';
SELECT * FROM cycling.cyclist_career_teams WHERE teams CONTAINS 'Rabobank-Liv Giant';

-- Q17:
-- CREATE INDEX - COLLECTION ON MAP KEYS
-- Find all cyclist/team combinations for a particular year
-- CREATE TABLE cycling.cyclist_teams ( id UUID PRIMARY KEY, lastname text, firstname text, teams map<int,text> );
CREATE INDEX team_year ON cycling.cyclist_teams (KEYS(teams));
SELECT * FROM cycling.cyclist_teams WHERE teams CONTAINS KEY 2015;

-- Q35:
-- CREATE INDEX - ENTRIES ON MAP KEYS
-- ONLY VALID FOR MAP TYPE
CREATE TABLE cycling.birthday_list (cyclist_name text PRIMARY KEY, blist map<text,text>);
INSERT INTO cycling.birthday_list (cyclist_name, blist) VALUES ('Allan DAVIS', {'age':'35', 'bday':'27/07/1980', 'nation':'AUSTRALIA'});
INSERT INTO cycling.birthday_list (cyclist_name, blist) VALUES ('Claudio VANDELLI', {'age':'54', 'bday':'27/07/1961', 'nation':'ITALY'});
INSERT INTO cycling.birthday_list (cyclist_name, blist) VALUES ('Laurence BOURQUE', {'age':'23', 'bday':'27/07/1992', 'nation':'CANADA'});
INSERT INTO cycling.birthday_list (cyclist_name, blist) VALUES ('Claudio HEINEN', {'age':'23', 'bday':'27/07/1992', 'nation':'GERMANY'});
INSERT INTO cycling.birthday_list (cyclist_name, blist) VALUES ('Luc HAGENAARS', {'age':'28', 'bday':'27/07/1987', 'nation':'NETHERLANDS'});
INSERT INTO cycling.birthday_list (cyclist_name, blist) VALUES ('Toine POELS', {'age':'52', 'bday':'27/07/1963', 'nation':'NETHERLANDS'});
CREATE INDEX blist_idx ON cycling.birthday_list (ENTRIES(blist));
SELECT * FROM cycling.birthday_list WHERE blist['age'] = '23';
SELECT * FROM cycling.birthday_list WHERE blist['nation'] = 'GERMANY';
SELECT * FROM cycling.birthday_list WHERE blist['bday'] = '27/07/1992';

-- Q36:
-- CREATE INDEX - FULL ON FROZEN COLLECTION
-- ONLY VALID FOR FROZEN COLLECTIONS (SET, LIST, MAP)
CREATE TABLE cycling.race_starts (cyclist_name text PRIMARY KEY, rnumbers FROZEN<LIST<int>>);
CREATE INDEX rnumbers_idx ON cycling.race_starts (FULL(rnumbers));
INSERT INTO cycling.race_starts (cyclist_name,rnumbers) VALUES ('Alexander KRISTOFF',[40,5,14]);
INSERT INTO cycling.race_starts (cyclist_name,rnumbers) VALUES ('Alejandro VALVERDE',[67,17,20]);
INSERT INTO cycling.race_starts (cyclist_name,rnumbers) VALUES ('Alberto CONTADOR',[61,14,7]);
INSERT INTO cycling.race_starts (cyclist_name,rnumbers) VALUES ('Christopher FROOME',[28,10,6]);
INSERT INTO cycling.race_starts (cyclist_name,rnumbers) VALUES ('John DEGENKOLB',[39,7,14]);
SELECT * FROM cycling.race_starts WHERE rnumbers = [39,7,14];

-- NOT A QUERY, JUST AN EXAMPLE
-- INSERT DATA IN JSON FORMAT
INSERT INTO cycling.cyclist_category JSON '{ "category" : "GC", "points" : 780, "id" : "829aa84a-4bba-411f-a4fb-38167a987cda", "lastname" : "SUTHERLAND" }';
-- null INSERTION EXAMPLE
INSERT INTO cycling.cyclist_category JSON '{ "category" : "Sprint", "points" : 700, "id" : "829aa84a-4bba-411f-a4fb-38167a987cda" }';

-- NOT A QUERY, JUST AN EXAMPLE
-- UPDATE SET
-- Can only be +
-- Add team to a cyclist's list of teams, order doesn't matter; this example adds it to the end
UPDATE cycling.cyclist_career_teams SET teams = teams + {'Team DSB - Ballast Nedam'} WHERE id=5b6962dd-3f90-4c93-8f61-eabfa4a803e2;

-- NOT A QUERY, JUST AN EXAMPLE
-- UPDATE LIST
-- Add events to the events list with either +/- or a specific place in the list like events[2]
UPDATE cycling.upcoming_calendar SET events = ['The Parx Casino Philly Cycling Classic'] + events WHERE year = 2015 AND month = 06;
UPDATE cycling.upcoming_calendar SET events[2] = 'Vuelta Ciclista a Venezuela' WHERE year = 2015 AND month = 06;

-- NOT A QUERY, JUST AN EXAMPLE
-- UPDATE MAP
-- Can only be +
UPDATE cycling.cyclist_teams SET teams = teams + {2009 : 'DSB Bank - Nederland bloeit'} WHERE id = 5b6962dd-3f90-4c93-8f61-eabfa4a803e2;
SELECT teams FROM cycling.cyclist_teams WHERE id = 5b6962dd-3f90-4c93-8f61-eabfa4a803e2;
UPDATE cycling.cyclist_teams SET teams[2006] = 'Team DSB - Ballast Nedam' WHERE id = 5b6962dd-3f90-4c93-8f61-eabfa4a803e2;

-- Q22:
-- UPDATE AND SELECT USING TTL
-- QUERY TO FIND TIME-TO-LIVE
-- Insert is to put in dummy record, UPDATE gives it a TTL
-- Repeated use of the SELECT will show the TTL as it counts down
INSERT INTO cycling.calendar (race_id, race_name, race_start_date, race_end_date) VALUES (200, 'placeholder', '2015-05-27', '2015-05-27') USING TTL;
UPDATE cycling.calendar USING TTL 300 SET race_name = 'dummy' WHERE race_id = 200 AND race_start_date = '2015-05-27' AND race_end_date = '2015-05-27';
SELECT TTL(race_name) FROM cycling.calendar WHERE race_id=200;

-- Q18:
-- QUERY WITH ORDER BY
-- Find all calendar events for a particular year and order by month
SELECT * FROM cycling.upcoming_calendar WHERE year= 2015 ORDER BY month DESC;

-- Q19:
-- QUERY WITH INEQUALITIES
-- Find all calendar events for a particular year between two set months
SELECT * FROM cycling.upcoming_calendar WHERE year = 2015 AND month <= 06 AND month >= 07;

-- NOT A QUERY, REALLY, JUST AN EXAMPLE
-- SELECT and GET RESULTS in JSON FORMAT
SELECT JSON month, year, events FROM cycling.upcoming_calendar;

-- Q20:
-- QUERY - WHERE ... IN SIMPLE
-- Notice the difference between using 'ORDER BY points DESC' and not using it - changes the order of reporting
-- Find all cyclists for a particular category and order by points
PAGING OFF;
SELECT * FROM cycling.cyclist_category WHERE category IN ('Time-trial', 'Sprint') ORDER BY id DESC;
PAGING OFF;
SELECT * FROM cycling.cyclist_category WHERE category IN ('Time-trial', 'Sprint') ORDER BY id ASC;

-- Q21:
-- QUERY - WHERE ... IN COMPLEX
-- Find particular races in a range of start and end dates
PAGING OFF;
SELECT * FROM cycling.calendar WHERE race_id IN (100, 101, 102) AND (race_start_date, race_end_date) IN (('2015-05-09','2015-05-31'),('2015-05-06', '2015-05-31'));
PAGING OFF;
SELECT * FROM cycling.calendar WHERE race_id IN (100, 101, 102) AND (race_start_date, race_end_date) >= ('2015-05-09','2015-05-24');

-- Q23 and 24:
-- Standard Aggregates
-- Find sum of cyclist points for a particular cyclist
-- Find the number of cyclists from a particular country
SELECT sum(race_points) FROM cycling.cyclist_points WHERE id = e3b19ec4-774a-4d1c-9e5a-decec1e30aac;
SELECT count(cyclist_name) FROM cycling.country_flag WHERE country='Belgium';

-- Q25
-- QUERY - SCAN A PARTITION
-- Find all cyclists that finished a race in a particular window of time
CREATE TABLE cycling.race_times (race_name text, cyclist_name text, race_time text, PRIMARY KEY (race_name, race_time));
INSERT INTO cycling.race_times (race_name, cyclist_name, race_time) VALUES ('17th Santos Tour Down Under', 'Rohan DENNIS', '19:15:18');
INSERT INTO cycling.race_times (race_name, cyclist_name, race_time) VALUES ('17th Santos Tour Down Under', 'Richie PORTE', '19:15:20');
INSERT INTO cycling.race_times (race_name, cyclist_name, race_time) VALUES ('17th Santos Tour Down Under', 'Cadel EVANS', '19:15:38');
INSERT INTO cycling.race_times (race_name, cyclist_name, race_time) VALUES ('17th Santos Tour Down Under', 'Tom DUMOULIN', '19:15:40');
SELECT * FROM cycling.race_times WHERE race_name = '17th Santos Tour Down Under' AND race_time >= '19:15:19' AND race_time <= '19:15:39';

-- NOT A QUERY, JUST AN EXAMPLE:
-- BATCH statement
-- Insert data into multiple tables using a BATCH statement
-- Note that what is inserted is data for the SAME cyclist, to two tables
BEGIN BATCH
  INSERT INTO cycling.cyclist_name (id, lastname, firstname) VALUES (c7fceba0-c141-4207-9494-a29f9809de6f, 'PIETERS', 'Amy');
  INSERT INTO cycling.cyclist_id (lastname, firstname, age, id) VALUES ('PIETERS', 'Amy', 23, c7fceba0-c141-4207-9494-a29f9809de6f);
APPLY BATCH;
SELECT * FROM cycling.cyclist_name;
SELECT * FROM cycling.cyclist_id;

-- NOT A QUERY, JUST AN EXAMPLE:
-- BATCH statement MISUSE
-- Insert data into same table, but involves multiple nodes due to partition key = id
BEGIN BATCH
INSERT INTO cycling.cyclist_name (id, lastname, firstname) VALUES  (6d5f1663-89c0-45fc-8cfd-60a373b01622,'HOSKINS', 'Melissa');
INSERT INTO cycling.cyclist_name (id, lastname, firstname) VALUES  (38ab64b6-26cc-4de9-ab28-c257cf011659,'FERNANDES', 'Marcia');
INSERT INTO cycling.cyclist_name (id, lastname, firstname) VALUES  (9011d3be-d35c-4a8d-83f7-a3c543789ee7,'NIEWIADOMA', 'Katarzyna');
INSERT INTO cycling.cyclist_name (id, lastname, firstname) VALUES  (95addc4c-459e-4ed7-b4b5-472f19a67995,'ADRIAN', 'Vera');
APPLY BATCH;

-- NOT A QUERY, JUST AN EXAMPLE:
-- BATCH statement WITH CONDITIONAL "IF NOT EXISTS"
-- EXAMPLE USES CYCLIST'S EXPENSES
CREATE TABLE cycling.cyclist_expenses ( cyclist_name text, balance float STATIC, expense_id int, amount float, description text, paid boolean, PRIMARY KEY (cyclist_name, expense_id) );
BEGIN BATCH
INSERT INTO cycling.cyclist_expenses (cyclist_name, balance) VALUES ('Vera ADRIAN', 0) IF NOT EXISTS;
INSERT INTO cycling.cyclist_expenses (cyclist_name, expense_id, amount, description, paid) VALUES ('Vera ADRIAN', 1, 7.95, 'Breakfast', false);
APPLY BATCH;

UPDATE cycling.cyclist_expenses SET balance = -7.95 WHERE cyclist_name = 'Vera ADRIAN' IF balance = 0;

-- NOT A QUERY, JUST AN EXAMPLE:
-- BATCH statement WITH CONDITIONAL "IF"
BEGIN BATCH
INSERT INTO cycling.cyclist_expenses (cyclist_name, expense_id, amount, description, paid) VALUES ('Vera ADRIAN', 2, 13.44, 'Lunch', true);
INSERT INTO cycling.cyclist_expenses (cyclist_name, expense_id, amount, description, paid) VALUES ('Vera ADRIAN', 3, 25.00, 'Dinner', false);
UPDATE cycling.cyclist_expenses SET balance = -32.95 WHERE cyclist_name = 'Vera ADRIAN' IF balance = -7.95;
APPLY BATCH;

-- NOT A QUERY, JUST AN EXAMPLE:
-- BATCH statement WITH CONDITIONAL "IF"
BEGIN BATCH
UPDATE cycling.cyclist_expenses SET balance = 0 WHERE cyclist_name = 'Vera ADRIAN' IF balance = -32.95;
UPDATE cycling.cyclist_expenses SET paid = true WHERE cyclist_name = 'Vera ADRIAN' AND expense_id = 1 IF paid = false;
UPDATE cycling.cyclist_expenses SET paid = true WHERE cyclist_name = 'Vera ADRIAN' AND expense_id = 3 IF paid = false;
APPLY BATCH;

-- NOT A QUERY, JUST AN EXAMPLE
-- LIGHTWEIGHT TRANSACTION
-- Insert or update information using a conditional statement
INSERT INTO cycling.cyclist_name (id, lastname, firstname) VALUES (c4b65263-fe58-4846-83e8-f0e1c13d518f, 'RATTO', 'Rissella') IF NOT EXISTS;

-- UPDATE USING LIGHTWEIGHT TRANSACTION
UPDATE cycling.cyclist_name SET firstname = 'Rossella' WHERE id=c4b65263-fe58-4846-83e8-f0e1c13d518f IF lastname = 'RATTO';

-- Q26
-- QUERY USING MULTIPLE INDEXES
-- DISCUSSION OF THE NEED FOR ALLOW FILTERING
-- IS THIS BETTER THAN cyclist_stats??
CREATE TABLE cycling.cyclist_alt_stats ( id UUID PRIMARY KEY, lastname text, birthday timestamp, nationality text, weight text, height text );
INSERT INTO cycling.cyclist_alt_stats (id, lastname, birthday, nationality, weight, height) VALUES (ed584e99-80f7-4b13-9a90-9dc5571e6821,'TSATEVICH', '1989-07-05', 'Russia', '64 kg', '1.69 m');
INSERT INTO cycling.cyclist_alt_stats (id, lastname, birthday, nationality, weight, height) VALUES (a9e96714-2dd0-41f9-8bd0-557196a44ecf,'ISAYCHEV', '1986-04-21', 'Russia', '80 kg', '1.88 m');
INSERT INTO cycling.cyclist_alt_stats (id, lastname, birthday, nationality, weight, height) VALUES (823ec386-2a46-45c9-be41-2425a4b7658e,'BELKOV', '1985-01-09', 'Russia', '71 kg', '1.84 m');
INSERT INTO cycling.cyclist_alt_stats (id, lastname, birthday, nationality, weight, height) VALUES (e0953617-07eb-4c82-8f91-3b2757981625,'BRUTT', '1982-01-29', 'Russia', '68 kg', '1.78 m');
INSERT INTO cycling.cyclist_alt_stats (id, lastname, birthday, nationality, weight, height) VALUES (078654a6-42fa-4142-ae43-cebdc67bd902,'LAGUTIN', '1981-01-14', 'Russia', '63 kg', '1.82 m');
INSERT INTO cycling.cyclist_alt_stats (id, lastname, birthday, nationality, weight, height) VALUES (d74d6e70-7484-4df5-8551-f5090c37f617,'GRMAY', '1991-08-25', 'Ethiopia', '63 kg', '1.75 m');
INSERT INTO cycling.cyclist_alt_stats (id, lastname, birthday, nationality, weight, height) VALUES (c09e9451-50da-483d-8108-e6bea2e827b3,'VEIKKANEN', '1981-03-29', 'Finland', '66 kg', '1.78 m');
INSERT INTO cycling.cyclist_alt_stats (id, lastname, birthday, nationality, weight, height) VALUES (f1deff54-7d96-4981-b14a-b70be4da82d2,'TLEUBAYEV', '1987-03-07', 'Kazakhstan', null, null);
INSERT INTO cycling.cyclist_alt_stats (id, lastname, birthday, nationality, weight, height) VALUES (1ba0417d-62da-4103-b710-de6fb227db6f,'PAULINHO', '1990-05-27', 'Portugal', null, null);
INSERT INTO cycling.cyclist_alt_stats (id, lastname, birthday, nationality, weight, height) VALUES (4ceb495c-55ab-4f71-83b9-81117252bb13,'DUVAL', '1990-05-27','France', null, null);
CREATE INDEX birthday_idx ON cycling.cyclist_alt_stats (birthday);
CREATE INDEX nationality_idx ON cycling.cyclist_alt_stats (nationality);
SELECT * FROM cycling.cyclist_alt_stats WHERE birthday = '1982-01-29' AND nationality = 'Russia' ALLOW FILTERING;
SELECT * FROM cycling.cyclist_alt_stats WHERE birthday = '1990-05-27' AND nationality = 'Portugal' ALLOW FILTERING;

-- Q27
-- USING EXPIRING DATA AND TTL TO DISPLAY THE LAST 3 DAYS race data
-- 3 days in seconds is 259,200
-- 2 days in seconds is 172800
-- Data will vanish when its TTL runs out
CREATE TABLE cycling.last_3_days (race_name text, year timestamp, rank int, cyclist_name text, PRIMARY KEY (year, rank, cyclist_name));
INSERT INTO cycling.last_3_days (race_name, year, rank, cyclist_name) VALUES ('Giro d''Italia Stage 16','2015-05-26',1,'Mikel Landa') USING TTL 259200;
INSERT INTO cycling.last_3_days (race_name, year, rank, cyclist_name) VALUES ('Giro d''Italia Stage 16','2015-05-26',2,'Steven Kruijswijk') USING TTL 259200;
INSERT INTO cycling.last_3_days (race_name, year, rank, cyclist_name) VALUES ('Giro d''Italia Stage 16','2015-05-26',3,'Alberto Contador') USING TTL 259200;
INSERT INTO cycling.last_3_days (race_name, year, rank, cyclist_name) VALUES ('National Championships United States - Road Race (NC)','2015-05-25',1,'Matthew Busche') USING TTL 172800;
INSERT INTO cycling.last_3_days (race_name, year, rank, cyclist_name) VALUES ('National Championships United States - Road Race (NC)','2015-05-25',2,'Joe Dombrowski') USING TTL 172800;
INSERT INTO cycling.last_3_days (race_name, year, rank, cyclist_name) VALUES ('National Championships United States - Road Race (NC)','2015-05-25',3,'Kiel Reijnen') USING TTL 172800;
SELECT TTL(race_name) FROM cycling.last_3_days;
SELECT TTL(race_name) FROM cycling.last_3_days;
SELECT * FROM cycling.last_3_days; // WILL ONLY SHOW NON-EXPIRED ROWS

-- Q28:
-- QUERY USING FUNCTION TOKEN()
-- Note how results are not consistent with dates alone; partitioner order is how they are returned
-- All 6 entries show
SELECT * FROM cycling.last_3_days WHERE token(year) > token ('2015-05-24');
-- No entries show
SELECT * FROM cycling.last_3_days WHERE token(year) > token ('2015-05-25');
-- 3 entries for 2015-05-25 show
SELECT * FROM cycling.last_3_days WHERE token(year) > token ('2015-05-26');
-- No entries show
SELECT * FROM cycling.last_3_days WHERE token(year) > token ('2015-05-27');
SELECT token(year) FROM cycling.last_3_days; //PRINTS partition hash
-- MIXED TOKEN AND PARTITION KEY
SELECT * FROM cycling.last_3_days WHERE token(year) < token ('2015-05-26') AND year IN ('2015-05-24','2015-05-25');


-- DELETE WHOLE ROW
-- Leave column(s) blank
DELETE FROM cycling.calendar WHERE race_id = 200;

-- DELETE COLUMN VALUE
DELETE lastname FROM cycling.cyclist_name WHERE id = c7fceba0-c141-4207-9494-a29f9809de6f;
UPDATE cycling.cyclist_name SET lastname = 'PIETERS' WHERE id = c7fceba0-c141-4207-9494-a29f9809de6f; // TO RESTORE THE COLUMN VALUE

-- DELETE ITEM FROM LIST
DELETE events[2] FROM cycling.upcoming_calendar WHERE year = 2015 AND month = 06;

-- DELETE ITEM FROM MAP
DELETE teams[2009] FROM cycling.cyclist_teams WHERE id=e7cd5752-bc0d-4157-a80f-7523add8dbcd;
UPDATE cycling.cyclist_teams SET teams = teams + {2009 : 'Team Flexpoint' } WHERE id = e7cd5752-bc0d-4157-a80f-7523add8dbcd; // TO RESTORE THE MAP VALUE

-- ALTER TABLE
-- ADD COLUMN
ALTER TABLE cycling.cyclist_alt_stats ADD age int;

-- ALTER TABLE WITH COLLECTION
ALTER TABLE cycling.upcoming_calendar ADD description map<text,text>;
UPDATE cycling.upcoming_calendar SET description = description + {'Criterium du Dauphine' : 'Easy race', 'Tour du Suisse' : 'Hard uphill race'} WHERE year = 2015 AND month = 6;

-- ALTER TABLE AND ALTER COLUMN TYPE
-- ADDS COLUMN as varchar and then changes it to text
ALTER TABLE cycling.cyclist_alt_stats ADD favorite_color varchar;
ALTER TABLE cycling.cyclist_alt_stats ALTER favorite_color TYPE text;


-- ALTER TYPE
ALTER TYPE cycling.fullname ADD middlename text;
ALTER TYPE cycling.fullname RENAME middlename TO middleinitial;

-- TUPLE WAS USED IN THE UDA TO HOLD 2 values - see example in UDA section

-- Q29:
-- TUPLE
-- Store the latitude/longitude waypoints for the route of a race
CREATE TABLE cycling.route (race_id int, race_name text, point_id int, lat_long tuple<text, tuple<float,float>>, PRIMARY KEY (race_id, point_id));
INSERT INTO cycling.route (race_id, race_name, point_id, lat_long) VALUES (500, '47th Tour du Pays de Vaud', 1, ('Onnens', (46.8444,6.6667)));
INSERT INTO cycling.route (race_id, race_name, point_id, lat_long) VALUES (500, '47th Tour du Pays de Vaud', 2, ('Champagne', (46.833, 6.65)));
INSERT INTO cycling.route (race_id, race_name, point_id, lat_long) VALUES (500, '47th Tour du Pays de Vaud', 3, ('Novalle', (46.833, 6.6)));
INSERT INTO cycling.route (race_id, race_name, point_id, lat_long) VALUES (500, '47th Tour du Pays de Vaud', 4, ('Vuiteboeuf', (46.8, 6.55)));
INSERT INTO cycling.route (race_id, race_name, point_id, lat_long) VALUES (500, '47th Tour du Pays de Vaud', 5, ('Baulmes', (46.7833, 6.5333)));
INSERT INTO cycling.route (race_id, race_name, point_id, lat_long) VALUES (500, '47th Tour du Pays de Vaud', 6, ('Les Clées', (46.7222, 6.5222)));
SELECT race_name, point_id, lat_long AS City_Latitude_Longitude FROM cycling.route; // Showcases 'AS' to rename column header

-- Q30:
-- QUERY USING DISTINCT
-- Find all the distinct race_id values from cycling.route
SELECT DISTINCT race_id from cycling.route;

-- Q31:
-- TUPLE
-- Rank nations by points, including top cyclist
-- tuple is rank, name, points
CREATE TABLE cycling.nation_rank ( nation text PRIMARY KEY, info tuple<int,text,int> );
INSERT INTO cycling.nation_rank (nation, info) VALUES ('Spain', (1,'Alejandro VALVERDE' , 9054));
INSERT INTO cycling.nation_rank (nation, info) VALUES ('France', (2,'Sylvain CHAVANEL' , 6339));
INSERT INTO cycling.nation_rank (nation, info) VALUES ('Belgium', (3,'Phillippe GILBERT' , 6222));
INSERT INTO cycling.nation_rank (nation, info) VALUES ('Italy', (4,'Davide REBELLINI' , 6090));
SELECT * FROM cycling.nation_rank;

-- Q32:
-- TUPLE
-- Popular Riders
CREATE TABLE cycling.popular (rank int PRIMARY KEY, cinfo tuple<text,text,int> );
INSERT INTO cycling.popular (rank, cinfo) VALUES (1, ('Spain', 'Mikel LANDA', 1137));
INSERT INTO cycling.popular (rank, cinfo) VALUES (2, ('Netherlands', 'Steven KRUIJSWIJK', 621));
INSERT INTO cycling.popular (rank, cinfo) VALUES (3, ('USA', 'Matthew BUSCHE', 230));
INSERT INTO cycling.popular (rank, cinfo) VALUES (4, ('Italy', 'Fabio ARU', 163));
INSERT INTO cycling.popular (rank, cinfo) VALUES (5, ('Canada', 'Ryder HESJEDAL', 148));
SELECT * FROM cycling.popular;

-- Q33:
-- COUNTER TABLE
-- Keep the count for popularity, incrementing or decrementing
CREATE TABLE cycling.popular_count ( id UUID PRIMARY KEY, popularity counter );
UPDATE cycling.popular_count SET popularity = popularity + 1 WHERE id = 6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47;
SELECT * FROM cycling.popular_count;
UPDATE cycling.popular_count SET popularity = popularity + 125 WHERE id = 6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47;
SELECT * FROM cycling.popular_count;
UPDATE cycling.popular_count SET popularity = popularity - 64 WHERE id = 6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47;
SELECT * FROM cycling.popular_count;

-- Q34:
-- Find the writetime for a column in a table
SELECT WRITETIME (firstname) FROM cycling.cyclist_points WHERE id=220844bf-4860-49d6-9a4b-6b5d3a79cbfb;

-- NOT A QUERY
-- INSERTING STRING CONSTANT USING DOUBLE DOLLAR SIGNS
INSERT INTO cycling.calendar (race_id, race_start_date, race_end_date, race_name) VALUES (201, '2015-02-18', '2015-02-22', $$Women's Tour of New Zealand$$);

-- ROLES, USERS, PERMISSIONS
-- cassandra.yaml must be changed to allow login with username and password
-- authenticator: PasswordAuthenticator (AllowAllAuthenticator by default)
-- authorizer: CassandraAuthorizer (AllowAllAuthorizer by default)
CREATE USER IF NOT EXISTS sandy WITH PASSWORD 'Ride2Win@' NOSUPERUSER;
CREATE USER chuck WITH PASSWORD 'Always1st$' SUPERUSER;
ALTER USER sandy SUPERUSER;
LIST USERS;
-- DROP USER IF EXISTS chuck;
CREATE ROLE IF NOT EXISTS team_manager WITH PASSWORD = 'RockIt4Us!';
CREATE ROLE sys_admin WITH PASSWORD = 'IcanDoIt4ll' AND LOGIN = true AND SUPERUSER = true;
ALTER ROLE sys_admin WITH PASSWORD = 'All4one1forAll' AND SUPERUSER = false;
GRANT sys_admin TO team_manager;
GRANT team_manager TO sandy;
LIST ROLES;
LIST ROLES OF sandy;
REVOKE sys_admin FROM team_manager;
REVOKE team_manager FROM sandy;
DROP ROLE IF EXISTS sys_admin;
GRANT MODIFY ON KEYSPACE cycling TO team_manager;
GRANT DESCRIBE ON ALL ROLES TO sys_admin;
GRANT AUTHORIZE ALL KEYSPACES TO sys_admin;
REVOKE SELECT ON ALL KEYSPACES FROM team_manager;
REVOKE EXECUTE ON FUNCTION cycling.fLog(double) FROM team_manager;
LIST ALL PERMISSIONS OF sandy;
LIST ALL PERMISSIONS ON cycling.cyclist_name OF chuck;

-- Q35:
-- MATERIALIZED VIEW
CREATE TABLE cycling.cyclist_mv (cid UUID PRIMARY KEY, name text, age int, birthday date, country text);
INSERT INTO cycling.cyclist_mv (cid,name,age,birthday,country) VALUES (e7ae5cf3-d358-4d99-b900-85902fda9bb0,'Alex FRAME', 22, 1993-06-18, 'New Zealand');
INSERT INTO cycling.cyclist_mv (cid,name,age,birthday,country) VALUES (220844bf-4860-49d6-9a4b-6b5d3a79cbfb,'Paolo TIRALONGO', 38, '1977-07-08', 'Italy');
INSERT INTO cycling.cyclist_mv (cid,name,age,birthday,country) VALUES (6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47,'Steven KRUIKSWIJK', 28, '1987-06-07', 'Netherlands');
INSERT INTO cycling.cyclist_mv (cid,name,age,birthday,country) VALUES (ffdfa2a7-5fc6-49a7-bfdc-3fcdcfdd7156,'Pascal EENKHOORN', 18, '1997-02-08', 'Netherlands');
INSERT INTO cycling.cyclist_mv (cid,name,age,birthday,country) VALUES (18f471bf-f631-4bc4-a9a2-d6f6cf5ea503,'Bram WELTEN', 18, '1997-03-29', 'Netherlands');
INSERT INTO cycling.cyclist_mv (cid,name,age,birthday,country) VALUES (15a116fc-b833-4da6-ab9a-4a7775752836,'Adrien COSTA', 18, '1997-08-19', 'United States');
INSERT INTO cycling.cyclist_mv (cid,name,age,birthday,country) VALUES (862cc51f-00a1-4d5a-976b-a359cab7300e,'Joakim BUKDAL', 20, '1994-09-04', 'Denmark');
INSERT INTO cycling.cyclist_mv (cid,name,age,birthday,country) VALUES (c9c9c484-5e4a-4542-8203-8d047a01b8a8,'Cristian EGIDIO', 27, '1987-09-04', 'Brazil');
INSERT INTO cycling.cyclist_mv (cid,name,age,birthday,country) VALUES (d1aad83b-be60-47a4-bd6e-069b8da0d97b,'Johannes HEIDER', 27, '1987-09-04','Germany');
CREATE MATERIALIZED VIEW cycling.cyclist_by_age AS SELECT age, birthday, name, country FROM cyclist_mv WHERE age is NOT NULL AND cid IS NOT NULL PRIMARY KEY (age, cid);
CREATE MATERIALIZED VIEW cycling.cyclist_by_country AS SELECT age, birthday, name, country FROM cyclist_mv WHERE country is NOT NULL AND cid IS NOT NULL PRIMARY KEY (country, cid);
CREATE MATERIALIZED VIEW cycling.cyclist_by_birthday AS SELECT age, birthday, name, country FROM cyclist_mv WHERE birthday is NOT NULL AND cid IS NOT NULL PRIMARY KEY (birthday, cid);
--DROP MATERIALIZED VIEW cycling.cyclist_by_age;

-- Q36:
-- USING TIMESTAMP
INSERT INTO cycling.calendar (race_id, race_name, race_start_date, race_end_date) VALUES (200, 'placeholder', '2015-05-27', '2015-05-27') USING TIMESTAMP 123456789;

-- exit
\q


================================================
FILE: contrib/cassandra/usql-config
================================================
DB="cassandra://cassandra:cassandra@localhost"
VSQL="SELECT release_version AS version FROM system.local WHERE key = 'local';"


================================================
FILE: contrib/charts/area_density_stacked.vl.json
================================================
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "title": "{{ header }}",
  "width": 400,
  "height": 80,
  "data": {
    "url": "data/penguins.json"
  },
  "mark": "area",
  "transform": [
    {
      "density": "{{ x }}",
      "groupby": ["Species"],
      "extent": [2500, 6500]
    }
  ],
  "encoding": {
    "x": {"field": "value", "type": "quantitative", "title": "{{ title_x }}"},
    "y": {"field": "density", "type": "quantitative", "stack": "zero"},
    "color": {"field": "{{ field_x }}", "type": "nominal"}
  }
}


================================================
FILE: contrib/charts/penguins.json
================================================
[
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 39.1,
    "Beak Depth (mm)": 18.7,
    "Flipper Length (mm)": 181,
    "Body Mass (g)": 3750,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 39.5,
    "Beak Depth (mm)": 17.4,
    "Flipper Length (mm)": 186,
    "Body Mass (g)": 3800,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 40.3,
    "Beak Depth (mm)": 18,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 3250,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": null,
    "Beak Depth (mm)": null,
    "Flipper Length (mm)": null,
    "Body Mass (g)": null,
    "Sex": null
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 36.7,
    "Beak Depth (mm)": 19.3,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 3450,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 39.3,
    "Beak Depth (mm)": 20.6,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3650,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 38.9,
    "Beak Depth (mm)": 17.8,
    "Flipper Length (mm)": 181,
    "Body Mass (g)": 3625,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 39.2,
    "Beak Depth (mm)": 19.6,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 4675,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 34.1,
    "Beak Depth (mm)": 18.1,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 3475,
    "Sex": null
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 42,
    "Beak Depth (mm)": 20.2,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 4250,
    "Sex": null
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 37.8,
    "Beak Depth (mm)": 17.1,
    "Flipper Length (mm)": 186,
    "Body Mass (g)": 3300,
    "Sex": null
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 37.8,
    "Beak Depth (mm)": 17.3,
    "Flipper Length (mm)": 180,
    "Body Mass (g)": 3700,
    "Sex": null
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 41.1,
    "Beak Depth (mm)": 17.6,
    "Flipper Length (mm)": 182,
    "Body Mass (g)": 3200,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 38.6,
    "Beak Depth (mm)": 21.2,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 3800,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 34.6,
    "Beak Depth (mm)": 21.1,
    "Flipper Length (mm)": 198,
    "Body Mass (g)": 4400,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 36.6,
    "Beak Depth (mm)": 17.8,
    "Flipper Length (mm)": 185,
    "Body Mass (g)": 3700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 38.7,
    "Beak Depth (mm)": 19,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 3450,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 42.5,
    "Beak Depth (mm)": 20.7,
    "Flipper Length (mm)": 197,
    "Body Mass (g)": 4500,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 34.4,
    "Beak Depth (mm)": 18.4,
    "Flipper Length (mm)": 184,
    "Body Mass (g)": 3325,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 46,
    "Beak Depth (mm)": 21.5,
    "Flipper Length (mm)": 194,
    "Body Mass (g)": 4200,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 37.8,
    "Beak Depth (mm)": 18.3,
    "Flipper Length (mm)": 174,
    "Body Mass (g)": 3400,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 37.7,
    "Beak Depth (mm)": 18.7,
    "Flipper Length (mm)": 180,
    "Body Mass (g)": 3600,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 35.9,
    "Beak Depth (mm)": 19.2,
    "Flipper Length (mm)": 189,
    "Body Mass (g)": 3800,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 38.2,
    "Beak Depth (mm)": 18.1,
    "Flipper Length (mm)": 185,
    "Body Mass (g)": 3950,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 38.8,
    "Beak Depth (mm)": 17.2,
    "Flipper Length (mm)": 180,
    "Body Mass (g)": 3800,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 35.3,
    "Beak Depth (mm)": 18.9,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3800,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 40.6,
    "Beak Depth (mm)": 18.6,
    "Flipper Length (mm)": 183,
    "Body Mass (g)": 3550,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 40.5,
    "Beak Depth (mm)": 17.9,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3200,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 37.9,
    "Beak Depth (mm)": 18.6,
    "Flipper Length (mm)": 172,
    "Body Mass (g)": 3150,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 40.5,
    "Beak Depth (mm)": 18.9,
    "Flipper Length (mm)": 180,
    "Body Mass (g)": 3950,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 39.5,
    "Beak Depth (mm)": 16.7,
    "Flipper Length (mm)": 178,
    "Body Mass (g)": 3250,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 37.2,
    "Beak Depth (mm)": 18.1,
    "Flipper Length (mm)": 178,
    "Body Mass (g)": 3900,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 39.5,
    "Beak Depth (mm)": 17.8,
    "Flipper Length (mm)": 188,
    "Body Mass (g)": 3300,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 40.9,
    "Beak Depth (mm)": 18.9,
    "Flipper Length (mm)": 184,
    "Body Mass (g)": 3900,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 36.4,
    "Beak Depth (mm)": 17,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 3325,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 39.2,
    "Beak Depth (mm)": 21.1,
    "Flipper Length (mm)": 196,
    "Body Mass (g)": 4150,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 38.8,
    "Beak Depth (mm)": 20,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3950,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 42.2,
    "Beak Depth (mm)": 18.5,
    "Flipper Length (mm)": 180,
    "Body Mass (g)": 3550,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 37.6,
    "Beak Depth (mm)": 19.3,
    "Flipper Length (mm)": 181,
    "Body Mass (g)": 3300,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 39.8,
    "Beak Depth (mm)": 19.1,
    "Flipper Length (mm)": 184,
    "Body Mass (g)": 4650,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 36.5,
    "Beak Depth (mm)": 18,
    "Flipper Length (mm)": 182,
    "Body Mass (g)": 3150,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 40.8,
    "Beak Depth (mm)": 18.4,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 3900,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 36,
    "Beak Depth (mm)": 18.5,
    "Flipper Length (mm)": 186,
    "Body Mass (g)": 3100,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 44.1,
    "Beak Depth (mm)": 19.7,
    "Flipper Length (mm)": 196,
    "Body Mass (g)": 4400,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 37,
    "Beak Depth (mm)": 16.9,
    "Flipper Length (mm)": 185,
    "Body Mass (g)": 3000,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 39.6,
    "Beak Depth (mm)": 18.8,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 4600,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 41.1,
    "Beak Depth (mm)": 19,
    "Flipper Length (mm)": 182,
    "Body Mass (g)": 3425,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 37.5,
    "Beak Depth (mm)": 18.9,
    "Flipper Length (mm)": 179,
    "Body Mass (g)": 2975,
    "Sex": null
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 36,
    "Beak Depth (mm)": 17.9,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3450,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 42.3,
    "Beak Depth (mm)": 21.2,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 4150,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 39.6,
    "Beak Depth (mm)": 17.7,
    "Flipper Length (mm)": 186,
    "Body Mass (g)": 3500,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 40.1,
    "Beak Depth (mm)": 18.9,
    "Flipper Length (mm)": 188,
    "Body Mass (g)": 4300,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 35,
    "Beak Depth (mm)": 17.9,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3450,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 42,
    "Beak Depth (mm)": 19.5,
    "Flipper Length (mm)": 200,
    "Body Mass (g)": 4050,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 34.5,
    "Beak Depth (mm)": 18.1,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 2900,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 41.4,
    "Beak Depth (mm)": 18.6,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 3700,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 39,
    "Beak Depth (mm)": 17.5,
    "Flipper Length (mm)": 186,
    "Body Mass (g)": 3550,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 40.6,
    "Beak Depth (mm)": 18.8,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 3800,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 36.5,
    "Beak Depth (mm)": 16.6,
    "Flipper Length (mm)": 181,
    "Body Mass (g)": 2850,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 37.6,
    "Beak Depth (mm)": 19.1,
    "Flipper Length (mm)": 194,
    "Body Mass (g)": 3750,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 35.7,
    "Beak Depth (mm)": 16.9,
    "Flipper Length (mm)": 185,
    "Body Mass (g)": 3150,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 41.3,
    "Beak Depth (mm)": 21.1,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 4400,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 37.6,
    "Beak Depth (mm)": 17,
    "Flipper Length (mm)": 185,
    "Body Mass (g)": 3600,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 41.1,
    "Beak Depth (mm)": 18.2,
    "Flipper Length (mm)": 192,
    "Body Mass (g)": 4050,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 36.4,
    "Beak Depth (mm)": 17.1,
    "Flipper Length (mm)": 184,
    "Body Mass (g)": 2850,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 41.6,
    "Beak Depth (mm)": 18,
    "Flipper Length (mm)": 192,
    "Body Mass (g)": 3950,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 35.5,
    "Beak Depth (mm)": 16.2,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 3350,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 41.1,
    "Beak Depth (mm)": 19.1,
    "Flipper Length (mm)": 188,
    "Body Mass (g)": 4100,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 35.9,
    "Beak Depth (mm)": 16.6,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3050,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 41.8,
    "Beak Depth (mm)": 19.4,
    "Flipper Length (mm)": 198,
    "Body Mass (g)": 4450,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 33.5,
    "Beak Depth (mm)": 19,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3600,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 39.7,
    "Beak Depth (mm)": 18.4,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3900,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 39.6,
    "Beak Depth (mm)": 17.2,
    "Flipper Length (mm)": 196,
    "Body Mass (g)": 3550,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 45.8,
    "Beak Depth (mm)": 18.9,
    "Flipper Length (mm)": 197,
    "Body Mass (g)": 4150,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 35.5,
    "Beak Depth (mm)": 17.5,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 42.8,
    "Beak Depth (mm)": 18.5,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 4250,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 40.9,
    "Beak Depth (mm)": 16.8,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 3700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 37.2,
    "Beak Depth (mm)": 19.4,
    "Flipper Length (mm)": 184,
    "Body Mass (g)": 3900,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 36.2,
    "Beak Depth (mm)": 16.1,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3550,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 42.1,
    "Beak Depth (mm)": 19.1,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 4000,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 34.6,
    "Beak Depth (mm)": 17.2,
    "Flipper Length (mm)": 189,
    "Body Mass (g)": 3200,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 42.9,
    "Beak Depth (mm)": 17.6,
    "Flipper Length (mm)": 196,
    "Body Mass (g)": 4700,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 36.7,
    "Beak Depth (mm)": 18.8,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3800,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 35.1,
    "Beak Depth (mm)": 19.4,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 4200,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 37.3,
    "Beak Depth (mm)": 17.8,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 3350,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 41.3,
    "Beak Depth (mm)": 20.3,
    "Flipper Length (mm)": 194,
    "Body Mass (g)": 3550,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 36.3,
    "Beak Depth (mm)": 19.5,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3800,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 36.9,
    "Beak Depth (mm)": 18.6,
    "Flipper Length (mm)": 189,
    "Body Mass (g)": 3500,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 38.3,
    "Beak Depth (mm)": 19.2,
    "Flipper Length (mm)": 189,
    "Body Mass (g)": 3950,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 38.9,
    "Beak Depth (mm)": 18.8,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3600,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 35.7,
    "Beak Depth (mm)": 18,
    "Flipper Length (mm)": 202,
    "Body Mass (g)": 3550,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 41.1,
    "Beak Depth (mm)": 18.1,
    "Flipper Length (mm)": 205,
    "Body Mass (g)": 4300,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 34,
    "Beak Depth (mm)": 17.1,
    "Flipper Length (mm)": 185,
    "Body Mass (g)": 3400,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 39.6,
    "Beak Depth (mm)": 18.1,
    "Flipper Length (mm)": 186,
    "Body Mass (g)": 4450,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 36.2,
    "Beak Depth (mm)": 17.3,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3300,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 40.8,
    "Beak Depth (mm)": 18.9,
    "Flipper Length (mm)": 208,
    "Body Mass (g)": 4300,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 38.1,
    "Beak Depth (mm)": 18.6,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 40.3,
    "Beak Depth (mm)": 18.5,
    "Flipper Length (mm)": 196,
    "Body Mass (g)": 4350,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 33.1,
    "Beak Depth (mm)": 16.1,
    "Flipper Length (mm)": 178,
    "Body Mass (g)": 2900,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 43.2,
    "Beak Depth (mm)": 18.5,
    "Flipper Length (mm)": 192,
    "Body Mass (g)": 4100,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 35,
    "Beak Depth (mm)": 17.9,
    "Flipper Length (mm)": 192,
    "Body Mass (g)": 3725,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 41,
    "Beak Depth (mm)": 20,
    "Flipper Length (mm)": 203,
    "Body Mass (g)": 4725,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 37.7,
    "Beak Depth (mm)": 16,
    "Flipper Length (mm)": 183,
    "Body Mass (g)": 3075,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 37.8,
    "Beak Depth (mm)": 20,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 4250,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 37.9,
    "Beak Depth (mm)": 18.6,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 2925,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 39.7,
    "Beak Depth (mm)": 18.9,
    "Flipper Length (mm)": 184,
    "Body Mass (g)": 3550,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 38.6,
    "Beak Depth (mm)": 17.2,
    "Flipper Length (mm)": 199,
    "Body Mass (g)": 3750,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 38.2,
    "Beak Depth (mm)": 20,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3900,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 38.1,
    "Beak Depth (mm)": 17,
    "Flipper Length (mm)": 181,
    "Body Mass (g)": 3175,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 43.2,
    "Beak Depth (mm)": 19,
    "Flipper Length (mm)": 197,
    "Body Mass (g)": 4775,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 38.1,
    "Beak Depth (mm)": 16.5,
    "Flipper Length (mm)": 198,
    "Body Mass (g)": 3825,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.6,
    "Beak Depth (mm)": 20.3,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 4600,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 39.7,
    "Beak Depth (mm)": 17.7,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 3200,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 42.2,
    "Beak Depth (mm)": 19.5,
    "Flipper Length (mm)": 197,
    "Body Mass (g)": 4275,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 39.6,
    "Beak Depth (mm)": 20.7,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 3900,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Biscoe",
    "Beak Length (mm)": 42.7,
    "Beak Depth (mm)": 18.3,
    "Flipper Length (mm)": 196,
    "Body Mass (g)": 4075,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 38.6,
    "Beak Depth (mm)": 17,
    "Flipper Length (mm)": 188,
    "Body Mass (g)": 2900,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 37.3,
    "Beak Depth (mm)": 20.5,
    "Flipper Length (mm)": 199,
    "Body Mass (g)": 3775,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 35.7,
    "Beak Depth (mm)": 17,
    "Flipper Length (mm)": 189,
    "Body Mass (g)": 3350,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 41.1,
    "Beak Depth (mm)": 18.6,
    "Flipper Length (mm)": 189,
    "Body Mass (g)": 3325,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 36.2,
    "Beak Depth (mm)": 17.2,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3150,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 37.7,
    "Beak Depth (mm)": 19.8,
    "Flipper Length (mm)": 198,
    "Body Mass (g)": 3500,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 40.2,
    "Beak Depth (mm)": 17,
    "Flipper Length (mm)": 176,
    "Body Mass (g)": 3450,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 41.4,
    "Beak Depth (mm)": 18.5,
    "Flipper Length (mm)": 202,
    "Body Mass (g)": 3875,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 35.2,
    "Beak Depth (mm)": 15.9,
    "Flipper Length (mm)": 186,
    "Body Mass (g)": 3050,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 40.6,
    "Beak Depth (mm)": 19,
    "Flipper Length (mm)": 199,
    "Body Mass (g)": 4000,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 38.8,
    "Beak Depth (mm)": 17.6,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 3275,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 41.5,
    "Beak Depth (mm)": 18.3,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 4300,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 39,
    "Beak Depth (mm)": 17.1,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 3050,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 44.1,
    "Beak Depth (mm)": 18,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 4000,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 38.5,
    "Beak Depth (mm)": 17.9,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3325,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Torgersen",
    "Beak Length (mm)": 43.1,
    "Beak Depth (mm)": 19.2,
    "Flipper Length (mm)": 197,
    "Body Mass (g)": 3500,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 36.8,
    "Beak Depth (mm)": 18.5,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 3500,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 37.5,
    "Beak Depth (mm)": 18.5,
    "Flipper Length (mm)": 199,
    "Body Mass (g)": 4475,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 38.1,
    "Beak Depth (mm)": 17.6,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3425,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 41.1,
    "Beak Depth (mm)": 17.5,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3900,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 35.6,
    "Beak Depth (mm)": 17.5,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 3175,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 40.2,
    "Beak Depth (mm)": 20.1,
    "Flipper Length (mm)": 200,
    "Body Mass (g)": 3975,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 37,
    "Beak Depth (mm)": 16.5,
    "Flipper Length (mm)": 185,
    "Body Mass (g)": 3400,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 39.7,
    "Beak Depth (mm)": 17.9,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 4250,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 40.2,
    "Beak Depth (mm)": 17.1,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 3400,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 40.6,
    "Beak Depth (mm)": 17.2,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3475,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 32.1,
    "Beak Depth (mm)": 15.5,
    "Flipper Length (mm)": 188,
    "Body Mass (g)": 3050,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 40.7,
    "Beak Depth (mm)": 17,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3725,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 37.3,
    "Beak Depth (mm)": 16.8,
    "Flipper Length (mm)": 192,
    "Body Mass (g)": 3000,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 39,
    "Beak Depth (mm)": 18.7,
    "Flipper Length (mm)": 185,
    "Body Mass (g)": 3650,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 39.2,
    "Beak Depth (mm)": 18.6,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 4250,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 36.6,
    "Beak Depth (mm)": 18.4,
    "Flipper Length (mm)": 184,
    "Body Mass (g)": 3475,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 36,
    "Beak Depth (mm)": 17.8,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 3450,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 37.8,
    "Beak Depth (mm)": 18.1,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 3750,
    "Sex": "MALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 36,
    "Beak Depth (mm)": 17.1,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Adelie",
    "Island": "Dream",
    "Beak Length (mm)": 41.5,
    "Beak Depth (mm)": 18.5,
    "Flipper Length (mm)": 201,
    "Body Mass (g)": 4000,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 46.5,
    "Beak Depth (mm)": 17.9,
    "Flipper Length (mm)": 192,
    "Body Mass (g)": 3500,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50,
    "Beak Depth (mm)": 19.5,
    "Flipper Length (mm)": 196,
    "Body Mass (g)": 3900,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 51.3,
    "Beak Depth (mm)": 19.2,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 3650,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 45.4,
    "Beak Depth (mm)": 18.7,
    "Flipper Length (mm)": 188,
    "Body Mass (g)": 3525,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 52.7,
    "Beak Depth (mm)": 19.8,
    "Flipper Length (mm)": 197,
    "Body Mass (g)": 3725,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 45.2,
    "Beak Depth (mm)": 17.8,
    "Flipper Length (mm)": 198,
    "Body Mass (g)": 3950,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 46.1,
    "Beak Depth (mm)": 18.2,
    "Flipper Length (mm)": 178,
    "Body Mass (g)": 3250,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 51.3,
    "Beak Depth (mm)": 18.2,
    "Flipper Length (mm)": 197,
    "Body Mass (g)": 3750,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 46,
    "Beak Depth (mm)": 18.9,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 4150,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 51.3,
    "Beak Depth (mm)": 19.9,
    "Flipper Length (mm)": 198,
    "Body Mass (g)": 3700,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 46.6,
    "Beak Depth (mm)": 17.8,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 3800,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 51.7,
    "Beak Depth (mm)": 20.3,
    "Flipper Length (mm)": 194,
    "Body Mass (g)": 3775,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 47,
    "Beak Depth (mm)": 17.3,
    "Flipper Length (mm)": 185,
    "Body Mass (g)": 3700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 52,
    "Beak Depth (mm)": 18.1,
    "Flipper Length (mm)": 201,
    "Body Mass (g)": 4050,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 45.9,
    "Beak Depth (mm)": 17.1,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3575,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50.5,
    "Beak Depth (mm)": 19.6,
    "Flipper Length (mm)": 201,
    "Body Mass (g)": 4050,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50.3,
    "Beak Depth (mm)": 20,
    "Flipper Length (mm)": 197,
    "Body Mass (g)": 3300,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 58,
    "Beak Depth (mm)": 17.8,
    "Flipper Length (mm)": 181,
    "Body Mass (g)": 3700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 46.4,
    "Beak Depth (mm)": 18.6,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3450,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 49.2,
    "Beak Depth (mm)": 18.2,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 4400,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 42.4,
    "Beak Depth (mm)": 17.3,
    "Flipper Length (mm)": 181,
    "Body Mass (g)": 3600,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 48.5,
    "Beak Depth (mm)": 17.5,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 3400,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 43.2,
    "Beak Depth (mm)": 16.6,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 2900,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50.6,
    "Beak Depth (mm)": 19.4,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 3800,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 46.7,
    "Beak Depth (mm)": 17.9,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 3300,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 52,
    "Beak Depth (mm)": 19,
    "Flipper Length (mm)": 197,
    "Body Mass (g)": 4150,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50.5,
    "Beak Depth (mm)": 18.4,
    "Flipper Length (mm)": 200,
    "Body Mass (g)": 3400,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 49.5,
    "Beak Depth (mm)": 19,
    "Flipper Length (mm)": 200,
    "Body Mass (g)": 3800,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 46.4,
    "Beak Depth (mm)": 17.8,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 3700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 52.8,
    "Beak Depth (mm)": 20,
    "Flipper Length (mm)": 205,
    "Body Mass (g)": 4550,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 40.9,
    "Beak Depth (mm)": 16.6,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3200,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 54.2,
    "Beak Depth (mm)": 20.8,
    "Flipper Length (mm)": 201,
    "Body Mass (g)": 4300,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 42.5,
    "Beak Depth (mm)": 16.7,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3350,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 51,
    "Beak Depth (mm)": 18.8,
    "Flipper Length (mm)": 203,
    "Body Mass (g)": 4100,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 49.7,
    "Beak Depth (mm)": 18.6,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 3600,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 47.5,
    "Beak Depth (mm)": 16.8,
    "Flipper Length (mm)": 199,
    "Body Mass (g)": 3900,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 47.6,
    "Beak Depth (mm)": 18.3,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 3850,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 52,
    "Beak Depth (mm)": 20.7,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 4800,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 46.9,
    "Beak Depth (mm)": 16.6,
    "Flipper Length (mm)": 192,
    "Body Mass (g)": 2700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 53.5,
    "Beak Depth (mm)": 19.9,
    "Flipper Length (mm)": 205,
    "Body Mass (g)": 4500,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 49,
    "Beak Depth (mm)": 19.5,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 3950,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 46.2,
    "Beak Depth (mm)": 17.5,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3650,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50.9,
    "Beak Depth (mm)": 19.1,
    "Flipper Length (mm)": 196,
    "Body Mass (g)": 3550,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 45.5,
    "Beak Depth (mm)": 17,
    "Flipper Length (mm)": 196,
    "Body Mass (g)": 3500,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50.9,
    "Beak Depth (mm)": 17.9,
    "Flipper Length (mm)": 196,
    "Body Mass (g)": 3675,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50.8,
    "Beak Depth (mm)": 18.5,
    "Flipper Length (mm)": 201,
    "Body Mass (g)": 4450,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50.1,
    "Beak Depth (mm)": 17.9,
    "Flipper Length (mm)": 190,
    "Body Mass (g)": 3400,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 49,
    "Beak Depth (mm)": 19.6,
    "Flipper Length (mm)": 212,
    "Body Mass (g)": 4300,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 51.5,
    "Beak Depth (mm)": 18.7,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3250,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 49.8,
    "Beak Depth (mm)": 17.3,
    "Flipper Length (mm)": 198,
    "Body Mass (g)": 3675,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 48.1,
    "Beak Depth (mm)": 16.4,
    "Flipper Length (mm)": 199,
    "Body Mass (g)": 3325,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 51.4,
    "Beak Depth (mm)": 19,
    "Flipper Length (mm)": 201,
    "Body Mass (g)": 3950,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 45.7,
    "Beak Depth (mm)": 17.3,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 3600,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50.7,
    "Beak Depth (mm)": 19.7,
    "Flipper Length (mm)": 203,
    "Body Mass (g)": 4050,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 42.5,
    "Beak Depth (mm)": 17.3,
    "Flipper Length (mm)": 187,
    "Body Mass (g)": 3350,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 52.2,
    "Beak Depth (mm)": 18.8,
    "Flipper Length (mm)": 197,
    "Body Mass (g)": 3450,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 45.2,
    "Beak Depth (mm)": 16.6,
    "Flipper Length (mm)": 191,
    "Body Mass (g)": 3250,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 49.3,
    "Beak Depth (mm)": 19.9,
    "Flipper Length (mm)": 203,
    "Body Mass (g)": 4050,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50.2,
    "Beak Depth (mm)": 18.8,
    "Flipper Length (mm)": 202,
    "Body Mass (g)": 3800,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 45.6,
    "Beak Depth (mm)": 19.4,
    "Flipper Length (mm)": 194,
    "Body Mass (g)": 3525,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 51.9,
    "Beak Depth (mm)": 19.5,
    "Flipper Length (mm)": 206,
    "Body Mass (g)": 3950,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 46.8,
    "Beak Depth (mm)": 16.5,
    "Flipper Length (mm)": 189,
    "Body Mass (g)": 3650,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 45.7,
    "Beak Depth (mm)": 17,
    "Flipper Length (mm)": 195,
    "Body Mass (g)": 3650,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 55.8,
    "Beak Depth (mm)": 19.8,
    "Flipper Length (mm)": 207,
    "Body Mass (g)": 4000,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 43.5,
    "Beak Depth (mm)": 18.1,
    "Flipper Length (mm)": 202,
    "Body Mass (g)": 3400,
    "Sex": "FEMALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 49.6,
    "Beak Depth (mm)": 18.2,
    "Flipper Length (mm)": 193,
    "Body Mass (g)": 3775,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50.8,
    "Beak Depth (mm)": 19,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 4100,
    "Sex": "MALE"
  },
  {
    "Species": "Chinstrap",
    "Island": "Dream",
    "Beak Length (mm)": 50.2,
    "Beak Depth (mm)": 18.7,
    "Flipper Length (mm)": 198,
    "Body Mass (g)": 3775,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.1,
    "Beak Depth (mm)": 13.2,
    "Flipper Length (mm)": 211,
    "Body Mass (g)": 4500,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 50,
    "Beak Depth (mm)": 16.3,
    "Flipper Length (mm)": 230,
    "Body Mass (g)": 5700,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 48.7,
    "Beak Depth (mm)": 14.1,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 4450,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 50,
    "Beak Depth (mm)": 15.2,
    "Flipper Length (mm)": 218,
    "Body Mass (g)": 5700,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 47.6,
    "Beak Depth (mm)": 14.5,
    "Flipper Length (mm)": 215,
    "Body Mass (g)": 5400,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.5,
    "Beak Depth (mm)": 13.5,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 4550,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.4,
    "Beak Depth (mm)": 14.6,
    "Flipper Length (mm)": 211,
    "Body Mass (g)": 4800,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.7,
    "Beak Depth (mm)": 15.3,
    "Flipper Length (mm)": 219,
    "Body Mass (g)": 5200,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 43.3,
    "Beak Depth (mm)": 13.4,
    "Flipper Length (mm)": 209,
    "Body Mass (g)": 4400,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.8,
    "Beak Depth (mm)": 15.4,
    "Flipper Length (mm)": 215,
    "Body Mass (g)": 5150,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 40.9,
    "Beak Depth (mm)": 13.7,
    "Flipper Length (mm)": 214,
    "Body Mass (g)": 4650,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 49,
    "Beak Depth (mm)": 16.1,
    "Flipper Length (mm)": 216,
    "Body Mass (g)": 5550,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.5,
    "Beak Depth (mm)": 13.7,
    "Flipper Length (mm)": 214,
    "Body Mass (g)": 4650,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 48.4,
    "Beak Depth (mm)": 14.6,
    "Flipper Length (mm)": 213,
    "Body Mass (g)": 5850,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.8,
    "Beak Depth (mm)": 14.6,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 4200,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 49.3,
    "Beak Depth (mm)": 15.7,
    "Flipper Length (mm)": 217,
    "Body Mass (g)": 5850,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 42,
    "Beak Depth (mm)": 13.5,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 4150,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 49.2,
    "Beak Depth (mm)": 15.2,
    "Flipper Length (mm)": 221,
    "Body Mass (g)": 6300,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.2,
    "Beak Depth (mm)": 14.5,
    "Flipper Length (mm)": 209,
    "Body Mass (g)": 4800,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 48.7,
    "Beak Depth (mm)": 15.1,
    "Flipper Length (mm)": 222,
    "Body Mass (g)": 5350,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 50.2,
    "Beak Depth (mm)": 14.3,
    "Flipper Length (mm)": 218,
    "Body Mass (g)": 5700,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.1,
    "Beak Depth (mm)": 14.5,
    "Flipper Length (mm)": 215,
    "Body Mass (g)": 5000,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.5,
    "Beak Depth (mm)": 14.5,
    "Flipper Length (mm)": 213,
    "Body Mass (g)": 4400,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.3,
    "Beak Depth (mm)": 15.8,
    "Flipper Length (mm)": 215,
    "Body Mass (g)": 5050,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 42.9,
    "Beak Depth (mm)": 13.1,
    "Flipper Length (mm)": 215,
    "Body Mass (g)": 5000,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.1,
    "Beak Depth (mm)": 15.1,
    "Flipper Length (mm)": 215,
    "Body Mass (g)": 5100,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 44.5,
    "Beak Depth (mm)": 14.3,
    "Flipper Length (mm)": 216,
    "Body Mass (g)": 4100,
    "Sex": null
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 47.8,
    "Beak Depth (mm)": 15,
    "Flipper Length (mm)": 215,
    "Body Mass (g)": 5650,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 48.2,
    "Beak Depth (mm)": 14.3,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 4600,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 50,
    "Beak Depth (mm)": 15.3,
    "Flipper Length (mm)": 220,
    "Body Mass (g)": 5550,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 47.3,
    "Beak Depth (mm)": 15.3,
    "Flipper Length (mm)": 222,
    "Body Mass (g)": 5250,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 42.8,
    "Beak Depth (mm)": 14.2,
    "Flipper Length (mm)": 209,
    "Body Mass (g)": 4700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.1,
    "Beak Depth (mm)": 14.5,
    "Flipper Length (mm)": 207,
    "Body Mass (g)": 5050,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 59.6,
    "Beak Depth (mm)": 17,
    "Flipper Length (mm)": 230,
    "Body Mass (g)": 6050,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 49.1,
    "Beak Depth (mm)": 14.8,
    "Flipper Length (mm)": 220,
    "Body Mass (g)": 5150,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 48.4,
    "Beak Depth (mm)": 16.3,
    "Flipper Length (mm)": 220,
    "Body Mass (g)": 5400,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 42.6,
    "Beak Depth (mm)": 13.7,
    "Flipper Length (mm)": 213,
    "Body Mass (g)": 4950,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 44.4,
    "Beak Depth (mm)": 17.3,
    "Flipper Length (mm)": 219,
    "Body Mass (g)": 5250,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 44,
    "Beak Depth (mm)": 13.6,
    "Flipper Length (mm)": 208,
    "Body Mass (g)": 4350,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 48.7,
    "Beak Depth (mm)": 15.7,
    "Flipper Length (mm)": 208,
    "Body Mass (g)": 5350,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 42.7,
    "Beak Depth (mm)": 13.7,
    "Flipper Length (mm)": 208,
    "Body Mass (g)": 3950,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 49.6,
    "Beak Depth (mm)": 16,
    "Flipper Length (mm)": 225,
    "Body Mass (g)": 5700,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.3,
    "Beak Depth (mm)": 13.7,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 4300,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 49.6,
    "Beak Depth (mm)": 15,
    "Flipper Length (mm)": 216,
    "Body Mass (g)": 4750,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 50.5,
    "Beak Depth (mm)": 15.9,
    "Flipper Length (mm)": 222,
    "Body Mass (g)": 5550,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 43.6,
    "Beak Depth (mm)": 13.9,
    "Flipper Length (mm)": 217,
    "Body Mass (g)": 4900,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.5,
    "Beak Depth (mm)": 13.9,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 4200,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 50.5,
    "Beak Depth (mm)": 15.9,
    "Flipper Length (mm)": 225,
    "Body Mass (g)": 5400,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 44.9,
    "Beak Depth (mm)": 13.3,
    "Flipper Length (mm)": 213,
    "Body Mass (g)": 5100,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.2,
    "Beak Depth (mm)": 15.8,
    "Flipper Length (mm)": 215,
    "Body Mass (g)": 5300,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.6,
    "Beak Depth (mm)": 14.2,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 4850,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 48.5,
    "Beak Depth (mm)": 14.1,
    "Flipper Length (mm)": 220,
    "Body Mass (g)": 5300,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.1,
    "Beak Depth (mm)": 14.4,
    "Flipper Length (mm)": 210,
    "Body Mass (g)": 4400,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 50.1,
    "Beak Depth (mm)": 15,
    "Flipper Length (mm)": 225,
    "Body Mass (g)": 5000,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.5,
    "Beak Depth (mm)": 14.4,
    "Flipper Length (mm)": 217,
    "Body Mass (g)": 4900,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45,
    "Beak Depth (mm)": 15.4,
    "Flipper Length (mm)": 220,
    "Body Mass (g)": 5050,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 43.8,
    "Beak Depth (mm)": 13.9,
    "Flipper Length (mm)": 208,
    "Body Mass (g)": 4300,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.5,
    "Beak Depth (mm)": 15,
    "Flipper Length (mm)": 220,
    "Body Mass (g)": 5000,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 43.2,
    "Beak Depth (mm)": 14.5,
    "Flipper Length (mm)": 208,
    "Body Mass (g)": 4450,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 50.4,
    "Beak Depth (mm)": 15.3,
    "Flipper Length (mm)": 224,
    "Body Mass (g)": 5550,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.3,
    "Beak Depth (mm)": 13.8,
    "Flipper Length (mm)": 208,
    "Body Mass (g)": 4200,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.2,
    "Beak Depth (mm)": 14.9,
    "Flipper Length (mm)": 221,
    "Body Mass (g)": 5300,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.7,
    "Beak Depth (mm)": 13.9,
    "Flipper Length (mm)": 214,
    "Body Mass (g)": 4400,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 54.3,
    "Beak Depth (mm)": 15.7,
    "Flipper Length (mm)": 231,
    "Body Mass (g)": 5650,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.8,
    "Beak Depth (mm)": 14.2,
    "Flipper Length (mm)": 219,
    "Body Mass (g)": 4700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 49.8,
    "Beak Depth (mm)": 16.8,
    "Flipper Length (mm)": 230,
    "Body Mass (g)": 5700,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.2,
    "Beak Depth (mm)": 14.4,
    "Flipper Length (mm)": 214,
    "Body Mass (g)": 4650,
    "Sex": null
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 49.5,
    "Beak Depth (mm)": 16.2,
    "Flipper Length (mm)": 229,
    "Body Mass (g)": 5800,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 43.5,
    "Beak Depth (mm)": 14.2,
    "Flipper Length (mm)": 220,
    "Body Mass (g)": 4700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 50.7,
    "Beak Depth (mm)": 15,
    "Flipper Length (mm)": 223,
    "Body Mass (g)": 5550,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 47.7,
    "Beak Depth (mm)": 15,
    "Flipper Length (mm)": 216,
    "Body Mass (g)": 4750,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.4,
    "Beak Depth (mm)": 15.6,
    "Flipper Length (mm)": 221,
    "Body Mass (g)": 5000,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 48.2,
    "Beak Depth (mm)": 15.6,
    "Flipper Length (mm)": 221,
    "Body Mass (g)": 5100,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.5,
    "Beak Depth (mm)": 14.8,
    "Flipper Length (mm)": 217,
    "Body Mass (g)": 5200,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 46.4,
    "Beak Depth (mm)": 15,
    "Flipper Length (mm)": 216,
    "Body Mass (g)": 4700,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 48.6,
    "Beak Depth (mm)": 16,
    "Flipper Length (mm)": 230,
    "Body Mass (g)": 5800,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 47.5,
    "Beak Depth (mm)": 14.2,
    "Flipper Length (mm)": 209,
    "Body Mass (g)": 4600,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 51.1,
    "Beak Depth (mm)": 16.3,
    "Flipper Length (mm)": 220,
    "Body Mass (g)": 6000,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.2,
    "Beak Depth (mm)": 13.8,
    "Flipper Length (mm)": 215,
    "Body Mass (g)": 4750,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.2,
    "Beak Depth (mm)": 16.4,
    "Flipper Length (mm)": 223,
    "Body Mass (g)": 5950,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 49.1,
    "Beak Depth (mm)": 14.5,
    "Flipper Length (mm)": 212,
    "Body Mass (g)": 4625,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 52.5,
    "Beak Depth (mm)": 15.6,
    "Flipper Length (mm)": 221,
    "Body Mass (g)": 5450,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 47.4,
    "Beak Depth (mm)": 14.6,
    "Flipper Length (mm)": 212,
    "Body Mass (g)": 4725,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 50,
    "Beak Depth (mm)": 15.9,
    "Flipper Length (mm)": 224,
    "Body Mass (g)": 5350,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 44.9,
    "Beak Depth (mm)": 13.8,
    "Flipper Length (mm)": 212,
    "Body Mass (g)": 4750,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 50.8,
    "Beak Depth (mm)": 17.3,
    "Flipper Length (mm)": 228,
    "Body Mass (g)": 5600,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 43.4,
    "Beak Depth (mm)": 14.4,
    "Flipper Length (mm)": 218,
    "Body Mass (g)": 4600,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 51.3,
    "Beak Depth (mm)": 14.2,
    "Flipper Length (mm)": 218,
    "Body Mass (g)": 5300,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 47.5,
    "Beak Depth (mm)": 14,
    "Flipper Length (mm)": 212,
    "Body Mass (g)": 4875,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 52.1,
    "Beak Depth (mm)": 17,
    "Flipper Length (mm)": 230,
    "Body Mass (g)": 5550,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 47.5,
    "Beak Depth (mm)": 15,
    "Flipper Length (mm)": 218,
    "Body Mass (g)": 4950,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 52.2,
    "Beak Depth (mm)": 17.1,
    "Flipper Length (mm)": 228,
    "Body Mass (g)": 5400,
    "Sex": "MALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 45.5,
    "Beak Depth (mm)": 14.5,
    "Flipper Length (mm)": 212,
    "Body Mass (g)": 4750,
    "Sex": "FEMALE"
  },
  {
    "Species": "Gentoo",
    "Island": "Biscoe",
    "Beak Length (mm)": 49.5,
    "Beak
Download .txt
gitextract_wko_uh41/

├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       ├── announce.yml
│       ├── release.yml
│       └── test.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── build.sh
├── contrib/
│   ├── adodb/
│   │   ├── adodb.sh
│   │   └── usql-config
│   ├── cassandra/
│   │   ├── podman-config
│   │   ├── test.sql
│   │   └── usql-config
│   ├── charts/
│   │   ├── area_density_stacked.vl.json
│   │   └── penguins.json
│   ├── clickhouse/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── cockroach/
│   │   └── podman-config
│   ├── config.yaml
│   ├── couchbase/
│   │   ├── README.md
│   │   ├── podman-config
│   │   └── usql-config
│   ├── db2/
│   │   ├── README.md
│   │   ├── db2cli-validate.sh
│   │   ├── db2dsdriver.cfg
│   │   ├── install-dsdriver.sh
│   │   ├── podman-config
│   │   ├── test.sql
│   │   └── usql-config
│   ├── duckdb/
│   │   └── usql-config
│   ├── exasol/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── firebird/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── flightsql/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── go-setup.sh
│   ├── godror/
│   │   ├── fix-oob-config.sh
│   │   ├── grab-instantclient.sh
│   │   └── usql-config
│   ├── h2/
│   │   └── podman-config
│   ├── hive/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── ignite/
│   │   ├── README.md
│   │   ├── activate.sh
│   │   ├── podman-config
│   │   └── usql-config
│   ├── mymysql/
│   │   └── usql-config
│   ├── mysql/
│   │   ├── podman-config
│   │   ├── test.sql
│   │   └── usql-config
│   ├── oracle/
│   │   ├── init.sql
│   │   ├── podman-config
│   │   └── usql-config
│   ├── oracle-enterprise/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── pgx/
│   │   └── usql-config
│   ├── podman-run.sh
│   ├── podman-stop.sh
│   ├── postgres/
│   │   ├── init.sql
│   │   ├── podman-config
│   │   ├── schema.sql
│   │   ├── test.sql
│   │   └── usql-config
│   ├── presto/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── sqlite3/
│   │   ├── build-windows-icu.sh
│   │   ├── icu-i18n-mingw64.pc
│   │   ├── test.sql
│   │   └── usql-config
│   ├── sqlserver/
│   │   ├── init.sql
│   │   ├── podman-config
│   │   ├── test.sql
│   │   └── usql-config
│   ├── trino/
│   │   ├── podman-config
│   │   └── usql-config
│   ├── usql-test.sh
│   ├── usqlpass
│   ├── usqlrc
│   ├── vertica/
│   │   ├── podman-config
│   │   └── usql-config
│   └── ydb/
│       ├── podman-config
│       └── usql-config
├── drivers/
│   ├── adodb/
│   │   └── adodb.go
│   ├── athena/
│   │   └── athena.go
│   ├── avatica/
│   │   └── avatica.go
│   ├── bigquery/
│   │   └── bigquery.go
│   ├── cassandra/
│   │   └── cassandra.go
│   ├── chai/
│   │   └── chai.go
│   ├── clickhouse/
│   │   ├── clickhouse.go
│   │   ├── clickhouse_test.go
│   │   ├── reader.go
│   │   └── testdata/
│   │       └── clickhouse.sql
│   ├── completer/
│   │   ├── completer.go
│   │   └── completer_test.go
│   ├── cosmos/
│   │   └── cosmos.go
│   ├── couchbase/
│   │   └── couchbase.go
│   ├── csvq/
│   │   └── csvq.go
│   ├── databend/
│   │   └── databend.go
│   ├── databricks/
│   │   └── databricks.go
│   ├── drivers.go
│   ├── drivers_test.go
│   ├── duckdb/
│   │   └── duckdb.go
│   ├── dynamodb/
│   │   └── dynamodb.go
│   ├── errors.go
│   ├── exasol/
│   │   └── exasol.go
│   ├── firebird/
│   │   └── firebird.go
│   ├── flightsql/
│   │   └── flightsql.go
│   ├── godror/
│   │   └── godror.go
│   ├── h2/
│   │   └── h2.go
│   ├── hive/
│   │   └── hive.go
│   ├── ignite/
│   │   └── ignite.go
│   ├── impala/
│   │   └── impala.go
│   ├── maxcompute/
│   │   └── maxcompute.go
│   ├── metadata/
│   │   ├── impala/
│   │   │   └── metadata.go
│   │   ├── informationschema/
│   │   │   ├── metadata.go
│   │   │   └── metadata_test.go
│   │   ├── metadata.go
│   │   ├── metadata_test.go
│   │   ├── mysql/
│   │   │   └── metadata.go
│   │   ├── oracle/
│   │   │   └── metadata.go
│   │   ├── postgres/
│   │   │   ├── metadata.go
│   │   │   └── metadata_test.go
│   │   ├── reader.go
│   │   └── writer.go
│   ├── moderncsqlite/
│   │   └── moderncsqlite.go
│   ├── mymysql/
│   │   └── mymysql.go
│   ├── mysql/
│   │   └── mysql.go
│   ├── netezza/
│   │   └── netezza.go
│   ├── odbc/
│   │   └── odbc.go
│   ├── oracle/
│   │   ├── oracle.go
│   │   └── orshared/
│   │       └── orshared.go
│   ├── ots/
│   │   └── ots.go
│   ├── pgx/
│   │   └── pgx.go
│   ├── postgres/
│   │   └── postgres.go
│   ├── presto/
│   │   └── presto.go
│   ├── ql/
│   │   └── ql.go
│   ├── qtype.go
│   ├── ramsql/
│   │   └── ramsql.go
│   ├── sapase/
│   │   └── sapase.go
│   ├── saphana/
│   │   └── saphana.go
│   ├── snowflake/
│   │   └── snowflake.go
│   ├── spanner/
│   │   └── spanner.go
│   ├── sqlite3/
│   │   ├── sqlite3.go
│   │   └── sqshared/
│   │       ├── reader.go
│   │       ├── reader_test.go
│   │       └── sqshared.go
│   ├── sqlserver/
│   │   ├── reader.go
│   │   ├── sqlserver.go
│   │   └── sqlserver_test.go
│   ├── testdata/
│   │   ├── .gitignore
│   │   ├── csvq/
│   │   │   └── .gitignore
│   │   ├── docker/
│   │   │   └── Dockerfile
│   │   ├── gen-golden.sh
│   │   ├── mysql.descTable.expected.txt
│   │   ├── mysql.descTable.golden.txt
│   │   ├── mysql.listFuncs.expected.txt
│   │   ├── mysql.listIndexes.expected.txt
│   │   ├── mysql.listSchemas.expected.txt
│   │   ├── mysql.listSchemas.golden.txt
│   │   ├── mysql.listTables.expected.txt
│   │   ├── mysql.listTables.golden.txt
│   │   ├── pgsql.descTable.expected.txt
│   │   ├── pgsql.descTable.golden.txt
│   │   ├── pgsql.listDbs.golden.txt
│   │   ├── pgsql.listFuncs.expected.txt
│   │   ├── pgsql.listFuncs.golden.txt
│   │   ├── pgsql.listIndexes.expected.txt
│   │   ├── pgsql.listIndexes.golden.txt
│   │   ├── pgsql.listSchemas.expected.txt
│   │   ├── pgsql.listSchemas.golden.txt
│   │   ├── pgsql.listTables.expected.txt
│   │   ├── pgsql.listTables.golden.txt
│   │   ├── sqlserver.descTable.expected.txt
│   │   ├── sqlserver.listFuncs.expected.txt
│   │   ├── sqlserver.listIndexes.expected.txt
│   │   ├── sqlserver.listSchemas.expected.txt
│   │   ├── sqlserver.listTables.expected.txt
│   │   ├── trino.descTable.expected.txt
│   │   ├── trino.listSchemas.expected.txt
│   │   └── trino.listTables.expected.txt
│   ├── trino/
│   │   ├── reader.go
│   │   └── trino.go
│   ├── vertica/
│   │   └── vertica.go
│   ├── voltdb/
│   │   └── voltdb.go
│   └── ydb/
│       └── ydb.go
├── env/
│   ├── env.go
│   ├── list.go
│   └── vars.go
├── gen.go
├── go.mod
├── go.sum
├── handler/
│   └── handler.go
├── internal/
│   ├── adodb.go
│   ├── athena.go
│   ├── avatica.go
│   ├── bigquery.go
│   ├── cassandra.go
│   ├── chai.go
│   ├── clickhouse.go
│   ├── cosmos.go
│   ├── couchbase.go
│   ├── csvq.go
│   ├── databend.go
│   ├── databricks.go
│   ├── duckdb.go
│   ├── dynamodb.go
│   ├── exasol.go
│   ├── firebird.go
│   ├── flightsql.go
│   ├── godror.go
│   ├── h2.go
│   ├── hive.go
│   ├── ignite.go
│   ├── impala.go
│   ├── internal.go
│   ├── maxcompute.go
│   ├── moderncsqlite.go
│   ├── mymysql.go
│   ├── mysql.go
│   ├── netezza.go
│   ├── odbc.go
│   ├── oracle.go
│   ├── ots.go
│   ├── pgx.go
│   ├── postgres.go
│   ├── presto.go
│   ├── ql.go
│   ├── ramsql.go
│   ├── sapase.go
│   ├── saphana.go
│   ├── snowflake.go
│   ├── spanner.go
│   ├── sqlite3.go
│   ├── sqlserver.go
│   ├── trino.go
│   ├── vertica.go
│   ├── voltdb.go
│   ├── ydb.go
│   └── z.go
├── main.go
├── main_test.go
├── metacmd/
│   ├── charts/
│   │   └── charts.go
│   ├── cmds.go
│   ├── descs.go
│   └── metacmd.go
├── rline/
│   └── rline.go
├── run.go
├── stmt/
│   ├── params.go
│   ├── params_test.go
│   ├── parse.go
│   ├── parse_test.go
│   ├── stmt.go
│   └── stmt_test.go
├── styles/
│   └── styles.go
├── testcli.go
├── testdata/
│   ├── copy.sql
│   ├── inc_test.sql
│   ├── inc_test_z.sql
│   ├── numbers.sql
│   ├── quotes.sql
│   └── sub/
│       ├── inc_test2.sql
│       └── inc_test_z.sql
├── text/
│   ├── errors.go
│   ├── license.go
│   └── text.go
└── update-deps.sh
Download .txt
SYMBOL INDEX (901 symbols across 104 files)

FILE: contrib/cassandra/test.sql
  type cycling (line 7) | CREATE TABLE cycling.cyclist_name ( id UUID PRIMARY KEY, lastname text, ...
  type cycling (line 20) | CREATE TABLE cycling.cyclist_category ( category text, points int, id UU...
  type cycling (line 34) | CREATE TABLE cycling.rank_by_year_and_name ( race_year int, race_name te...
  type cycling (line 55) | CREATE TABLE cycling.cyclist_id ( lastname text, firstname text, age int...
  type c_age (line 61) | CREATE INDEX c_age ON cycling.cyclist_id (age)
  type cycling (line 67) | CREATE TABLE cycling.country_flag (country text, cyclist_name text, flag...
  type cycling (line 78) | CREATE TABLE cycling.cyclist_career_teams ( id UUID PRIMARY KEY, lastnam...
  type cycling (line 89) | CREATE TABLE cycling.calendar (race_id int, race_name text, race_start_d...
  type cycling (line 104) | CREATE TABLE cycling.upcoming_calendar ( year int, month int, events lis...
  type cycling (line 112) | CREATE TABLE cycling.race_winners (race_name text, race_position int, cy...
  type cycling (line 125) | CREATE TABLE cycling.cyclist_races ( id UUID PRIMARY KEY, lastname text,...
  type cycling (line 137) | CREATE TABLE cycling.cyclist_teams ( id UUID PRIMARY KEY, lastname text,...
  type cycling (line 149) | CREATE TABLE cycling.cyclist_stats ( id UUID, lastname text, basics FROZ...
  type cycling (line 159) | CREATE TABLE cycling.cyclist_stats ( id UUID, lastname text, basics basi...
  type cycling (line 167) | CREATE TABLE cycling.cyclist_points (id UUID, firstname text, lastname t...
  type cycling (line 180) | CREATE TABLE cycling.cyclist_points (id UUID, firstname text, lastname t...
  function cycling (line 185) | CREATE OR REPLACE FUNCTION cycling.fLog (input double) CALLED ON NULL IN...
  function cycling (line 192) | CREATE OR REPLACE FUNCTION cycling.avgState ( state tuple<int,bigint>, v...
  function cycling (line 193) | CREATE OR REPLACE FUNCTION cycling.avgFinal ( state tuple<int,bigint> ) ...
  type cycling (line 195) | CREATE TABLE cycling.team_average (team_name text, cyclist_name text, cy...
  type ryear (line 208) | CREATE INDEX ryear ON cycling.rank_by_year_and_name (race_year)
  type rrank (line 212) | CREATE INDEX rrank ON cycling.rank_by_year_and_name (rank)
  type team (line 218) | CREATE INDEX team ON cycling.cyclist_career_teams (teams)
  type team_year (line 226) | CREATE INDEX team_year ON cycling.cyclist_teams (KEYS(teams))
  type cycling (line 232) | CREATE TABLE cycling.birthday_list (cyclist_name text PRIMARY KEY, blist...
  type blist_idx (line 239) | CREATE INDEX blist_idx ON cycling.birthday_list (ENTRIES(blist))
  type cycling (line 247) | CREATE TABLE cycling.race_starts (cyclist_name text PRIMARY KEY, rnumber...
  type rnumbers_idx (line 248) | CREATE INDEX rnumbers_idx ON cycling.race_starts (FULL(rnumbers))
  type cycling (line 331) | CREATE TABLE cycling.race_times (race_name text, cyclist_name text, race...
  type cycling (line 362) | CREATE TABLE cycling.cyclist_expenses ( cyclist_name text, balance float...
  type cycling (line 398) | CREATE TABLE cycling.cyclist_alt_stats ( id UUID PRIMARY KEY, lastname t...
  type birthday_idx (line 409) | CREATE INDEX birthday_idx ON cycling.cyclist_alt_stats (birthday)
  type nationality_idx (line 410) | CREATE INDEX nationality_idx ON cycling.cyclist_alt_stats (nationality)
  type cycling (line 419) | CREATE TABLE cycling.last_3_days (race_name text, year timestamp, rank i...
  type cycling (line 484) | CREATE TABLE cycling.route (race_id int, race_name text, point_id int, l...
  type cycling (line 502) | CREATE TABLE cycling.nation_rank ( nation text PRIMARY KEY, info tuple<i...
  type cycling (line 512) | CREATE TABLE cycling.popular (rank int PRIMARY KEY, cinfo tuple<text,tex...
  type cycling (line 523) | CREATE TABLE cycling.popular_count ( id UUID PRIMARY KEY, popularity cou...
  type cycling (line 568) | CREATE TABLE cycling.cyclist_mv (cid UUID PRIMARY KEY, name text, age in...

FILE: contrib/db2/test.sql
  type test (line 5) | create table test.mytable (

FILE: contrib/mysql/test.sql
  type authors (line 27) | CREATE TABLE authors (
  type authors_name_idx (line 32) | CREATE INDEX authors_name_idx ON authors(name(255))
  type books_title_idx (line 51) | CREATE INDEX books_title_idx ON books(title, year)
  function say_hello (line 89) | CREATE FUNCTION say_hello(s text) RETURNS text

FILE: contrib/postgres/schema.sql
  type authors (line 8) | CREATE TABLE authors (
  type authors_name_idx (line 13) | CREATE INDEX authors_name_idx ON authors(name)
  type books (line 20) | CREATE TABLE books (
  type books_title_idx (line 31) | CREATE INDEX books_title_idx ON books(title, year)
  function say_hello (line 33) | CREATE FUNCTION say_hello(text) RETURNS text AS $$
  type books_title_lower_idx (line 39) | CREATE INDEX books_title_lower_idx ON books(title)

FILE: contrib/postgres/test.sql
  type authors (line 27) | CREATE TABLE authors (
  type authors_name_idx (line 31) | CREATE INDEX authors_name_idx ON authors(name)
  type authors_name_idx (line 37) | CREATE INDEX authors_name_idx ON authors(name)
  type books_title_idx (line 55) | CREATE INDEX books_title_idx ON books(title, year)
  function say_hello (line 93) | CREATE FUNCTION say_hello(text) RETURNS text AS $$

FILE: contrib/sqlite3/test.sql
  type authors (line 27) | CREATE TABLE authors (
  type authors_name_idx (line 32) | CREATE INDEX authors_name_idx ON authors(name)
  type books_title_idx (line 49) | CREATE INDEX books_title_idx ON books(title, year)

FILE: contrib/sqlserver/test.sql
  type authors (line 22) | CREATE TABLE authors (
  type authors_name_idx (line 27) | CREATE INDEX authors_name_idx ON authors(name)
  type books (line 29) | CREATE TABLE books (
  type books_title_idx (line 39) | CREATE INDEX books_title_idx ON books(title, year)

FILE: drivers/adodb/adodb.go
  function init (line 19) | func init() {

FILE: drivers/athena/athena.go
  function init (line 13) | func init() {

FILE: drivers/avatica/avatica.go
  function init (line 14) | func init() {

FILE: drivers/bigquery/bigquery.go
  function init (line 11) | func init() {

FILE: drivers/cassandra/cassandra.go
  function init (line 23) | func init() {
  type logger (line 97) | type logger struct
    method Print (line 102) | func (l *logger) Print(v ...interface{}) {
    method Printf (line 108) | func (l *logger) Printf(s string, v ...interface{}) {
    method Println (line 114) | func (l *logger) Println(v ...interface{}) {
    method Write (line 120) | func (l *logger) Write(buf []byte) (int, error) {

FILE: drivers/chai/chai.go
  function init (line 11) | func init() {

FILE: drivers/clickhouse/clickhouse.go
  function init (line 16) | func init() {

FILE: drivers/clickhouse/clickhouse_test.go
  function TestMain (line 32) | func TestMain(m *testing.M) {
  function doMain (line 45) | func doMain(m *testing.M, cleanup bool) (int, error) {
  function TestSchemas (line 90) | func TestSchemas(t *testing.T) {
  function TestTables (line 98) | func TestTables(t *testing.T) {
  function TestFunctions (line 109) | func TestFunctions(t *testing.T) {
  function TestColumns (line 118) | func TestColumns(t *testing.T) {
  function TestCopy (line 129) | func TestCopy(t *testing.T) {
  function testCopy (line 146) | func testCopy(t *testing.T, destTableSpec string, sourceDbUrlStr string) {
  function checkNames (line 198) | func checkNames(t *testing.T, typ string, res interface{ Next() bool }, ...
  function getName (line 223) | func getName(res interface{}) string {
  function funcNames (line 237) | func funcNames() []string {
  function colNames (line 1502) | func colNames() []string {

FILE: drivers/clickhouse/reader.go
  type MetadataReader (line 11) | type MetadataReader struct
    method Tables (line 22) | func (r MetadataReader) Tables(f metadata.Filter) (*metadata.TableSet,...
    method Columns (line 78) | func (r MetadataReader) Columns(f metadata.Filter) (*metadata.ColumnSe...
    method Schemas (line 135) | func (r MetadataReader) Schemas(f metadata.Filter) (*metadata.SchemaSe...
    method Functions (line 165) | func (r MetadataReader) Functions(f metadata.Filter) (*metadata.Functi...
    method query (line 211) | func (r MetadataReader) query(qstr string, conds []string, order strin...
  function NewMetadataReader (line 16) | func NewMetadataReader(db drivers.DB, opts ...metadata.ReaderOption) met...

FILE: drivers/clickhouse/testdata/clickhouse.sql
  type tutorial (line 4) | CREATE TABLE tutorial.hits_v1 (
  type tutorial (line 145) | CREATE TABLE tutorial.visits_v1 (
  type tutorial_unexpected (line 338) | CREATE TABLE tutorial_unexpected.hits_v1 (
  type copy_test (line 345) | CREATE TABLE copy_test.dest (

FILE: drivers/completer/completer.go
  constant WORD_BREAKS (line 19) | WORD_BREAKS = "\t\n$><=;|&{() "
  type caseType (line 22) | type caseType
  function NewDefaultCompleter (line 113) | func NewDefaultCompleter(opts ...Option) readline.AutoCompleter {
  type Option (line 212) | type Option
  function WithDB (line 215) | func WithDB(db metadata.DB) Option {
  function WithReader (line 222) | func WithReader(r metadata.Reader) Option {
  function WithLogger (line 229) | func WithLogger(l logger) Option {
  function WithSQLStartCommands (line 236) | func WithSQLStartCommands(commands []string) Option {
  function WithSQLCommands (line 243) | func WithSQLCommands(commands []string) Option {
  function WithConnStrings (line 250) | func WithConnStrings(connStrings []string) Option {
  function WithBeforeComplete (line 257) | func WithBeforeComplete(f CompleteFunc) Option {
  type completer (line 264) | type completer struct
    method Do (line 282) | func (c completer) Do(line []rune, start int) (newLine [][]rune, lengt...
    method complete (line 309) | func (c completer) complete(previousWords []string, text []rune) [][]r...
    method completeWithSelectables (line 703) | func (c completer) completeWithSelectables(text []rune) [][]rune {
    method completeWithTables (line 747) | func (c completer) completeWithTables(text []rune, types []string) [][...
    method completeWithFunctions (line 770) | func (c completer) completeWithFunctions(text []rune, types []string) ...
    method completeWithIndexes (line 792) | func (c completer) completeWithIndexes(text []rune) [][]rune {
    method completeWithSequences (line 813) | func (c completer) completeWithSequences(text []rune) [][]rune {
    method completeWithSchemas (line 834) | func (c completer) completeWithSchemas(text []rune) [][]rune {
    method completeWithCatalogs (line 856) | func (c completer) completeWithCatalogs(text []rune) [][]rune {
    method completeWithUpdatables (line 874) | func (c completer) completeWithUpdatables(text []rune) [][]rune {
    method getNamespaces (line 896) | func (c completer) getNamespaces(f metadata.Filter) []string {
    method completeWithAttributes (line 932) | func (c completer) completeWithAttributes(_ caseType, selectable strin...
    method getNames (line 1025) | func (c completer) getNames(query func() (iterator, error), mapper fun...
  type CompleteFunc (line 276) | type CompleteFunc
  type logger (line 278) | type logger interface
  function getPreviousWords (line 521) | func getPreviousWords(point int, buf []rune) []string {
  function TailMatches (line 604) | func TailMatches(ct caseType, words []string, patterns ...string) bool {
  function matches (line 616) | func matches(ct caseType, words []string, patterns ...string) bool {
  function wordMatches (line 628) | func wordMatches(ct caseType, pattern, word string) bool {
  function CompleteFromList (line 659) | func CompleteFromList(text []rune, options ...string) [][]rune {
  function CompleteFromListCase (line 664) | func CompleteFromListCase(ct caseType, text []rune, options ...string) [...
  function completeFromVariables (line 691) | func completeFromVariables(text []rune, prefix, suffix string, needValue...
  function parseIdentifier (line 965) | func parseIdentifier(name string) metadata.Filter {
  function parseParentIdentifier (line 990) | func parseParentIdentifier(name string) metadata.Filter {
  function qualifiedIdentifier (line 1014) | func qualifiedIdentifier(filter metadata.Filter, catalog, schema, name s...
  type iterator (line 1047) | type iterator interface
  function completeFromFiles (line 1052) | func completeFromFiles(text []rune) [][]rune {

FILE: drivers/completer/completer_test.go
  function TestCompleter (line 9) | func TestCompleter(t *testing.T) {
  type mockReader (line 329) | type mockReader struct
    method Catalogs (line 334) | func (r mockReader) Catalogs(metadata.Filter) (*metadata.CatalogSet, e...
    method Schemas (line 345) | func (r mockReader) Schemas(metadata.Filter) (*metadata.SchemaSet, err...
    method Tables (line 358) | func (r mockReader) Tables(f metadata.Filter) (*metadata.TableSet, err...
    method Columns (line 373) | func (r mockReader) Columns(f metadata.Filter) (*metadata.ColumnSet, e...

FILE: drivers/cosmos/cosmos.go
  function init (line 11) | func init() {

FILE: drivers/couchbase/couchbase.go
  function init (line 15) | func init() {

FILE: drivers/csvq/csvq.go
  function init (line 18) | func init() {

FILE: drivers/databend/databend.go
  function init (line 15) | func init() {

FILE: drivers/databricks/databricks.go
  function init (line 14) | func init() {

FILE: drivers/drivers.go
  type DB (line 29) | type DB interface
  type Driver (line 41) | type Driver struct
  function Available (line 116) | func Available() map[string]Driver {
  function Register (line 121) | func Register(name string, d Driver, aliases ...string) {
  function Registered (line 135) | func Registered(name string) bool {
  function LowerColumnNames (line 142) | func LowerColumnNames(u *dburl.URL) bool {
  function UseColumnTypes (line 150) | func UseColumnTypes(u *dburl.URL) bool {
  function ForceParams (line 158) | func ForceParams(u *dburl.URL) {
  function Open (line 166) | func Open(ctx context.Context, u *dburl.URL, stdout, stderr func() io.Wr...
  function stmtOpts (line 190) | func stmtOpts(u *dburl.URL) []stmt.Option {
  function NewStmt (line 210) | func NewStmt(u *dburl.URL, f func() ([]rune, error), opts ...stmt.Option...
  function ConfigStmt (line 215) | func ConfigStmt(u *dburl.URL, s *stmt.Stmt) {
  function Version (line 225) | func Version(ctx context.Context, u *dburl.URL, db DB) (string, error) {
  function User (line 239) | func User(ctx context.Context, u *dburl.URL, db DB) (string, error) {
  function Process (line 250) | func Process(u *dburl.URL, prefix, sqlstr string) (string, string, bool,...
  function ColumnTypes (line 260) | func ColumnTypes(u *dburl.URL) func(*sql.ColumnType) (interface{}, error) {
  function IsPasswordErr (line 265) | func IsPasswordErr(u *dburl.URL, err error) bool {
  function RequirePreviousPassword (line 278) | func RequirePreviousPassword(u *dburl.URL) bool {
  function CanChangePassword (line 287) | func CanChangePassword(u *dburl.URL) error {
  function ChangePassword (line 296) | func ChangePassword(u *dburl.URL, db DB, user, new, old string) (string,...
  function Columns (line 310) | func Columns(u *dburl.URL, rows *sql.Rows) ([]string, error) {
  function ConvertBytes (line 333) | func ConvertBytes(u *dburl.URL) func([]byte, string) (string, error) {
  function ConvertMap (line 344) | func ConvertMap(u *dburl.URL) func(map[string]interface{}) (string, erro...
  function ConvertSlice (line 359) | func ConvertSlice(u *dburl.URL) func([]interface{}) (string, error) {
  function ConvertDefault (line 374) | func ConvertDefault(u *dburl.URL) func(interface{}) (string, error) {
  function BatchAsTransaction (line 385) | func BatchAsTransaction(u *dburl.URL) bool {
  function IsBatchQueryPrefix (line 395) | func IsBatchQueryPrefix(u *dburl.URL, prefix string) (string, string, bo...
  function RowsAffected (line 407) | func RowsAffected(u *dburl.URL, res sql.Result) (int64, error) {
  function Ping (line 425) | func Ping(ctx context.Context, u *dburl.URL, db *sql.DB) error {
  function Lexer (line 430) | func Lexer(u *dburl.URL) chroma.Lexer {
  function ForceQueryParameters (line 446) | func ForceQueryParameters(params []string) func(*dburl.URL) {
  function NewMetadataReader (line 462) | func NewMetadataReader(ctx context.Context, u *dburl.URL, db DB, w io.Wr...
  function NewMetadataWriter (line 471) | func NewMetadataWriter(ctx context.Context, u *dburl.URL, db DB, w io.Wr...
  function NewCompleter (line 488) | func NewCompleter(ctx context.Context, u *dburl.URL, db DB, readerOpts [...
  function Copy (line 513) | func Copy(ctx context.Context, u *dburl.URL, stdout, stderr func() io.Wr...
  function CopyWithInsert (line 530) | func CopyWithInsert(placeholder func(int) string) func(ctx context.Conte...
  function FlexibleCopyWithInsert (line 539) | func FlexibleCopyWithInsert(ctx context.Context, db *sql.DB, rows *sql.R...
  function init (line 625) | func init() {
  function StripTrailingSemicolon (line 631) | func StripTrailingSemicolon(_ *dburl.URL, prefix string, sqlstr string) ...

FILE: drivers/drivers_test.go
  type Database (line 28) | type Database struct
  constant pw (line 42) | pw = "yourStrong123_Password"
  function TestMain (line 126) | func TestMain(m *testing.M) {
  function getConnInfo (line 214) | func getConnInfo(dbName string, db *Database, pool *dt.Pool) (string, st...
  function TestWriter (line 243) | func TestWriter(t *testing.T) {
  function TestCopy (line 421) | func TestCopy(t *testing.T) {
  function filesEqual (line 544) | func filesEqual(a, b, ignore string) error {

FILE: drivers/duckdb/duckdb.go
  type metaReader (line 20) | type metaReader struct
    method Catalogs (line 29) | func (r metaReader) Catalogs(metadata.Filter) (*metadata.CatalogSet, e...
    method ColumnStats (line 52) | func (r metaReader) ColumnStats(f metadata.Filter) (*metadata.ColumnSt...
  function init (line 117) | func init() {

FILE: drivers/dynamodb/dynamodb.go
  function init (line 11) | func init() {

FILE: drivers/errors.go
  type Error (line 9) | type Error struct
    method Error (line 28) | func (e *Error) Error() string {
    method Unwrap (line 51) | func (e *Error) Unwrap() error {
  function WrapErr (line 15) | func WrapErr(driver string, err error) error {
  function chop (line 56) | func chop(s, prefix string) string {

FILE: drivers/exasol/exasol.go
  function init (line 14) | func init() {

FILE: drivers/firebird/firebird.go
  function init (line 13) | func init() {

FILE: drivers/flightsql/flightsql.go
  function init (line 11) | func init() {

FILE: drivers/godror/godror.go
  function init (line 17) | func init() {

FILE: drivers/h2/h2.go
  function init (line 11) | func init() {

FILE: drivers/hive/hive.go
  function init (line 12) | func init() {

FILE: drivers/ignite/ignite.go
  function init (line 14) | func init() {

FILE: drivers/impala/impala.go
  function init (line 16) | func init() {

FILE: drivers/maxcompute/maxcompute.go
  function init (line 11) | func init() {

FILE: drivers/metadata/impala/metadata.go
  type MetaReader (line 13) | type MetaReader struct
    method Columns (line 17) | func (r MetaReader) Columns(filter metadata.Filter) (*metadata.ColumnS...
    method Schemas (line 33) | func (r MetaReader) Schemas(filter metadata.Filter) (*metadata.SchemaS...
    method Tables (line 47) | func (r MetaReader) Tables(filter metadata.Filter) (*metadata.TableSet...
  function New (line 69) | func New(db drivers.DB, _ ...metadata.ReaderOption) metadata.Reader {

FILE: drivers/metadata/informationschema/metadata.go
  type InformationSchema (line 17) | type InformationSchema struct
    method SetLimit (line 203) | func (s *InformationSchema) SetLimit(l int) {
    method Columns (line 208) | func (s InformationSchema) Columns(f metadata.Filter) (*metadata.Colum...
    method Tables (line 270) | func (s InformationSchema) Tables(f metadata.Filter) (*metadata.TableS...
    method Schemas (line 340) | func (s InformationSchema) Schemas(f metadata.Filter) (*metadata.Schem...
    method Functions (line 376) | func (s InformationSchema) Functions(f metadata.Filter) (*metadata.Fun...
    method FunctionColumns (line 438) | func (s InformationSchema) FunctionColumns(f metadata.Filter) (*metada...
    method Indexes (line 502) | func (s InformationSchema) Indexes(f metadata.Filter) (*metadata.Index...
    method IndexColumns (line 557) | func (s InformationSchema) IndexColumns(f metadata.Filter) (*metadata....
    method Constraints (line 610) | func (s InformationSchema) Constraints(f metadata.Filter) (*metadata.C...
    method ConstraintColumns (line 699) | func (s InformationSchema) ConstraintColumns(f metadata.Filter) (*meta...
    method Sequences (line 806) | func (s InformationSchema) Sequences(f metadata.Filter) (*metadata.Seq...
    method PrivilegeSummaries (line 855) | func (s InformationSchema) PrivilegeSummaries(f metadata.Filter) (*met...
    method conditions (line 1002) | func (s InformationSchema) conditions(baseParam int, filter metadata.F...
    method query (line 1073) | func (s InformationSchema) query(qstr string, conds []string, order st...
  type Logger (line 37) | type Logger interface
  type ClauseName (line 41) | type ClauseName
  constant ColumnsDataType (line 44) | ColumnsDataType         = ClauseName("columns.data_type")
  constant ColumnsColumnSize (line 45) | ColumnsColumnSize       = ClauseName("columns.column_size")
  constant ColumnsNumericScale (line 46) | ColumnsNumericScale     = ClauseName("columns.numeric_scale")
  constant ColumnsNumericPrecRadix (line 47) | ColumnsNumericPrecRadix = ClauseName("columns.numeric_precision_radix")
  constant ColumnsCharOctetLength (line 48) | ColumnsCharOctetLength  = ClauseName("columns.character_octet_length")
  constant FunctionColumnsColumnSize (line 50) | FunctionColumnsColumnSize       = ClauseName("function_columns.column_si...
  constant FunctionColumnsNumericScale (line 51) | FunctionColumnsNumericScale     = ClauseName("function_columns.numeric_s...
  constant FunctionColumnsNumericPrecRadix (line 52) | FunctionColumnsNumericPrecRadix = ClauseName("function_columns.numeric_p...
  constant FunctionColumnsCharOctetLength (line 53) | FunctionColumnsCharOctetLength  = ClauseName("function_columns.character...
  constant FunctionsSecurityType (line 55) | FunctionsSecurityType = ClauseName("functions.security_type")
  constant ConstraintIsDeferrable (line 57) | ConstraintIsDeferrable      = ClauseName("constraint_columns.is_deferrab...
  constant ConstraintInitiallyDeferred (line 58) | ConstraintInitiallyDeferred = ClauseName("constraint_columns.initially_d...
  constant ConstraintJoinCond (line 59) | ConstraintJoinCond          = ClauseName("constraint_join.fk")
  constant SequenceColumnsIncrement (line 61) | SequenceColumnsIncrement = ClauseName("sequence_columns.increment")
  constant PrivilegesGrantor (line 63) | PrivilegesGrantor = ClauseName("privileges.grantor")
  function New (line 67) | func New(opts ...metadata.ReaderOption) func(drivers.DB, ...metadata.Rea...
  function WithPlaceholder (line 110) | func WithPlaceholder(pf func(int) string) metadata.ReaderOption {
  function WithCustomClauses (line 117) | func WithCustomClauses(cols map[ClauseName]string) metadata.ReaderOption {
  function WithFunctions (line 126) | func WithFunctions(fun bool) metadata.ReaderOption {
  function WithIndexes (line 133) | func WithIndexes(ind bool) metadata.ReaderOption {
  function WithConstraints (line 140) | func WithConstraints(con bool) metadata.ReaderOption {
  function WithCheckConstraints (line 147) | func WithCheckConstraints(con bool) metadata.ReaderOption {
  function WithSequences (line 154) | func WithSequences(seq bool) metadata.ReaderOption {
  function WithTablePrivileges (line 161) | func WithTablePrivileges(t bool) metadata.ReaderOption {
  function WithColumnPrivileges (line 168) | func WithColumnPrivileges(c bool) metadata.ReaderOption {
  function WithUsagePrivileges (line 175) | func WithUsagePrivileges(u bool) metadata.ReaderOption {
  function WithSystemSchemas (line 182) | func WithSystemSchemas(schemas []string) metadata.ReaderOption {
  function WithCurrentSchema (line 189) | func WithCurrentSchema(expr string) metadata.ReaderOption {
  function WithDataTypeFormatter (line 197) | func WithDataTypeFormatter(f func(metadata.Column) string) metadata.Read...
  type formats (line 1063) | type formats struct

FILE: drivers/metadata/informationschema/metadata_test.go
  type Database (line 28) | type Database struct
  constant pw (line 43) | pw = "yourStrong123_Password"
  function TestMain (line 175) | func TestMain(m *testing.M) {
  function waitForDbConnection (line 260) | func waitForDbConnection(driver string, pool *dt.Pool, url string, port ...
  function TestSchemas (line 276) | func TestSchemas(t *testing.T) {
  function TestTables (line 302) | func TestTables(t *testing.T) {
  function TestColumns (line 334) | func TestColumns(t *testing.T) {
  function TestFunctions (line 381) | func TestFunctions(t *testing.T) {
  function TestFunctionColumns (line 412) | func TestFunctionColumns(t *testing.T) {
  function TestIndexes (line 447) | func TestIndexes(t *testing.T) {
  function TestIndexColumns (line 476) | func TestIndexColumns(t *testing.T) {
  function TestConstraints (line 508) | func TestConstraints(t *testing.T) {
  function TestConstraintColumns (line 543) | func TestConstraintColumns(t *testing.T) {
  function TestReverseConstraints (line 578) | func TestReverseConstraints(t *testing.T) {
  function TestSequences (line 613) | func TestSequences(t *testing.T) {
  function TestPrivilegeSummaries_NonExistent (line 642) | func TestPrivilegeSummaries_NonExistent(t *testing.T) {
  function TestPrivilegeSummaries (line 675) | func TestPrivilegeSummaries(t *testing.T) {

FILE: drivers/metadata/metadata.go
  type ExtendedReader (line 11) | type ExtendedReader interface
  type BasicReader (line 29) | type BasicReader interface
  type CatalogReader (line 36) | type CatalogReader interface
  type SchemaReader (line 42) | type SchemaReader interface
  type TableReader (line 48) | type TableReader interface
  type ColumnReader (line 54) | type ColumnReader interface
  type ColumnStatReader (line 60) | type ColumnStatReader interface
  type IndexReader (line 66) | type IndexReader interface
  type IndexColumnReader (line 72) | type IndexColumnReader interface
  type TriggerReader (line 78) | type TriggerReader interface
  type ConstraintReader (line 84) | type ConstraintReader interface
  type ConstraintColumnReader (line 90) | type ConstraintColumnReader interface
  type FunctionReader (line 96) | type FunctionReader interface
  type FunctionColumnReader (line 102) | type FunctionColumnReader interface
  type SequenceReader (line 108) | type SequenceReader interface
  type PrivilegeSummaryReader (line 114) | type PrivilegeSummaryReader interface
  type Reader (line 120) | type Reader interface
  type Filter (line 123) | type Filter struct
  type Writer (line 146) | type Writer interface
  type CatalogSet (line 165) | type CatalogSet struct
    method Get (line 195) | func (s CatalogSet) Get() Catalog {
  function NewCatalogSet (line 169) | func NewCatalogSet(v []Catalog) *CatalogSet {
  function NewCatalogSetWithColumns (line 182) | func NewCatalogSetWithColumns(v []Result, cols []string) *CatalogSet {
  type CatalogProvider (line 191) | type CatalogProvider interface
  type Catalog (line 200) | type Catalog struct
    method Values (line 204) | func (s Catalog) Values() []interface{} {
    method GetCatalog (line 208) | func (s Catalog) GetCatalog() Catalog {
  type SchemaSet (line 212) | type SchemaSet struct
    method Get (line 229) | func (s SchemaSet) Get() *Schema {
  function NewSchemaSet (line 216) | func NewSchemaSet(v []Schema) *SchemaSet {
  type Schema (line 233) | type Schema struct
    method Values (line 238) | func (s Schema) Values() []interface{} {
  type TableSet (line 242) | type TableSet struct
    method Get (line 269) | func (t TableSet) Get() *Table {
  function NewTableSet (line 246) | func NewTableSet(v []Table) *TableSet {
  type Table (line 273) | type Table struct
    method Values (line 283) | func (t Table) Values() []interface{} {
  type ColumnSet (line 295) | type ColumnSet struct
    method Get (line 326) | func (c ColumnSet) Get() *Column {
  function NewColumnSet (line 299) | func NewColumnSet(v []Column) *ColumnSet {
  type Column (line 330) | type Column struct
    method Values (line 354) | func (c Column) Values() []interface{} {
  type Bool (line 346) | type Bool
  type ColumnStatSet (line 370) | type ColumnStatSet struct
    method Get (line 401) | func (c ColumnStatSet) Get() *ColumnStat {
  function NewColumnStatSet (line 374) | func NewColumnStatSet(v []ColumnStat) *ColumnStatSet {
  type ColumnStat (line 405) | type ColumnStat struct
    method Values (line 420) | func (c ColumnStat) Values() []interface{} {
  type IndexSet (line 437) | type IndexSet struct
    method Get (line 464) | func (i IndexSet) Get() *Index {
  function NewIndexSet (line 441) | func NewIndexSet(v []Index) *IndexSet {
  type Index (line 468) | type Index struct
    method Values (line 479) | func (i Index) Values() []interface{} {
  type IndexColumnSet (line 491) | type IndexColumnSet struct
    method Get (line 516) | func (c IndexColumnSet) Get() *IndexColumn {
  function NewIndexColumnSet (line 495) | func NewIndexColumnSet(v []IndexColumn) *IndexColumnSet {
  type IndexColumn (line 520) | type IndexColumn struct
    method Values (line 530) | func (c IndexColumn) Values() []interface{} {
  type ConstraintSet (line 541) | type ConstraintSet struct
    method Get (line 577) | func (i ConstraintSet) Get() *Constraint {
  function NewConstraintSet (line 545) | func NewConstraintSet(v []Constraint) *ConstraintSet {
  type Constraint (line 581) | type Constraint struct
    method Values (line 602) | func (i Constraint) Values() []interface{} {
  type ConstraintColumnSet (line 621) | type ConstraintColumnSet struct
    method Get (line 649) | func (c ConstraintColumnSet) Get() *ConstraintColumn {
  function NewConstraintColumnSet (line 625) | func NewConstraintColumnSet(v []ConstraintColumn) *ConstraintColumnSet {
  type ConstraintColumn (line 653) | type ConstraintColumn struct
    method Values (line 668) | func (c ConstraintColumn) Values() []interface{} {
  type FunctionSet (line 683) | type FunctionSet struct
    method Get (line 713) | func (f FunctionSet) Get() *Function {
  function NewFunctionSet (line 687) | func NewFunctionSet(v []Function) *FunctionSet {
  type Function (line 717) | type Function struct
    method Values (line 732) | func (f Function) Values() []interface{} {
  type FunctionColumnSet (line 747) | type FunctionColumnSet struct
    method Get (line 777) | func (c FunctionColumnSet) Get() *FunctionColumn {
  function NewFunctionColumnSet (line 751) | func NewFunctionColumnSet(v []FunctionColumn) *FunctionColumnSet {
  type FunctionColumn (line 781) | type FunctionColumn struct
    method Values (line 797) | func (c FunctionColumn) Values() []interface{} {
  type SequenceSet (line 812) | type SequenceSet struct
    method Get (line 836) | func (s SequenceSet) Get() *Sequence {
  function NewSequenceSet (line 816) | func NewSequenceSet(v []Sequence) *SequenceSet {
  type Sequence (line 840) | type Sequence struct
    method Values (line 852) | func (s Sequence) Values() []interface{} {
  type PrivilegeSummarySet (line 863) | type PrivilegeSummarySet struct
    method Get (line 886) | func (s PrivilegeSummarySet) Get() *PrivilegeSummary {
  function NewPrivilegeSummarySet (line 867) | func NewPrivilegeSummarySet(v []PrivilegeSummary) *PrivilegeSummarySet {
  type PrivilegeSummary (line 891) | type PrivilegeSummary struct
    method Values (line 900) | func (s PrivilegeSummary) Values() []interface{} {
  type ObjectPrivilege (line 912) | type ObjectPrivilege struct
  type ColumnPrivilege (line 920) | type ColumnPrivilege struct
  type ObjectPrivileges (line 931) | type ObjectPrivileges
    method Len (line 938) | func (p ObjectPrivileges) Len() int      { return len(p) }
    method Swap (line 939) | func (p ObjectPrivileges) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
    method Less (line 940) | func (p ObjectPrivileges) Less(i, j int) bool {
    method String (line 952) | func (p ObjectPrivileges) String() string {
  type ColumnPrivileges (line 936) | type ColumnPrivileges
    method Len (line 973) | func (p ColumnPrivileges) Len() int      { return len(p) }
    method Swap (line 974) | func (p ColumnPrivileges) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
    method Less (line 975) | func (p ColumnPrivileges) Less(i, j int) bool {
    method String (line 989) | func (p ColumnPrivileges) String() string {
  function typeStr (line 1019) | func typeStr(privilege string, grantable bool) string {
  function lineStr (line 1028) | func lineStr(grantee, grantor string, types []string) string {
  type resultSet (line 1036) | type resultSet struct
    method SetFilter (line 1048) | func (r *resultSet) SetFilter(f func(Result) bool) {
    method SetColumns (line 1052) | func (r *resultSet) SetColumns(c []string) {
    method SetScanValues (line 1056) | func (r *resultSet) SetScanValues(s func(Result) []interface{}) {
    method Len (line 1060) | func (r *resultSet) Len() int {
    method Reset (line 1073) | func (r *resultSet) Reset() {
    method Next (line 1077) | func (r *resultSet) Next() bool {
    method Columns (line 1087) | func (r resultSet) Columns() ([]string, error) {
    method Scan (line 1091) | func (r resultSet) Scan(dest ...interface{}) error {
    method Close (line 1108) | func (r resultSet) Close() error {
    method Err (line 1112) | func (r resultSet) Err() error {
    method NextResultSet (line 1116) | func (r resultSet) NextResultSet() bool {
  type Result (line 1044) | type Result interface
  type Trigger (line 1120) | type Trigger struct
    method Values (line 1128) | func (t Trigger) Values() []interface{} {
  type TriggerSet (line 1138) | type TriggerSet struct
    method Get (line 1161) | func (t TriggerSet) Get() *Trigger {
  function NewTriggerSet (line 1142) | func NewTriggerSet(t []Trigger) *TriggerSet {

FILE: drivers/metadata/metadata_test.go
  function TestAccessPrivileges_String (line 9) | func TestAccessPrivileges_String(t *testing.T) {
  function TestColumnPrivileges_String (line 66) | func TestColumnPrivileges_String(t *testing.T) {

FILE: drivers/metadata/mysql/metadata.go
  function complete (line 50) | func complete(reader metadata.Reader) completer.CompleteFunc {
  function completeWithSchemas (line 59) | func completeWithSchemas(reader metadata.Reader, text []rune) [][]rune {

FILE: drivers/metadata/oracle/metadata.go
  type metaReader (line 13) | type metaReader struct
    method Catalogs (line 32) | func (r metaReader) Catalogs(metadata.Filter) (*metadata.CatalogSet, e...
    method Schemas (line 68) | func (r metaReader) Schemas(f metadata.Filter) (*metadata.SchemaSet, e...
    method Tables (line 107) | func (r metaReader) Tables(f metadata.Filter) (*metadata.TableSet, err...
    method Columns (line 174) | func (r metaReader) Columns(f metadata.Filter) (*metadata.ColumnSet, e...
    method Functions (line 239) | func (r metaReader) Functions(f metadata.Filter) (*metadata.FunctionSe...
    method FunctionColumns (line 290) | func (r metaReader) FunctionColumns(f metadata.Filter) (*metadata.Func...
    method Indexes (line 348) | func (r metaReader) Indexes(f metadata.Filter) (*metadata.IndexSet, er...
    method IndexColumns (line 392) | func (r metaReader) IndexColumns(f metadata.Filter) (*metadata.IndexCo...
    method conditions (line 437) | func (r metaReader) conditions(filter metadata.Filter, formats formats...
  function NewReader (line 22) | func NewReader() func(drivers.DB, ...metadata.ReaderOption) metadata.Rea...
  type formats (line 478) | type formats struct

FILE: drivers/metadata/postgres/metadata.go
  type metaReader (line 15) | type metaReader struct
    method SetLimit (line 76) | func (r *metaReader) SetLimit(l int) {
    method Catalogs (line 101) | func (r metaReader) Catalogs(metadata.Filter) (*metadata.CatalogSet, e...
    method Tables (line 132) | func (r metaReader) Tables(f metadata.Filter) (*metadata.TableSet, err...
    method ColumnStats (line 198) | func (r metaReader) ColumnStats(f metadata.Filter) (*metadata.ColumnSt...
    method Indexes (line 271) | func (r metaReader) Indexes(f metadata.Filter) (*metadata.IndexSet, er...
    method IndexColumns (line 335) | func (r metaReader) IndexColumns(f metadata.Filter) (*metadata.IndexCo...
    method Triggers (line 399) | func (r metaReader) Triggers(f metadata.Filter) (*metadata.TriggerSet,...
    method query (line 455) | func (r metaReader) query(qstr string, conds []string, order string, v...
  function NewReader (line 27) | func NewReader() func(drivers.DB, ...metadata.ReaderOption) metadata.Rea...
  function dataTypeFormatter (line 47) | func dataTypeFormatter(col metadata.Column) string {
  type Catalog (line 80) | type Catalog struct
    method Values (line 89) | func (s Catalog) Values() []interface{} {
    method GetCatalog (line 93) | func (s Catalog) GetCatalog() metadata.Catalog {

FILE: drivers/metadata/postgres/metadata_test.go
  type Database (line 19) | type Database struct
  function TestMain (line 51) | func TestMain(m *testing.M) {
  function TestTriggers (line 107) | func TestTriggers(t *testing.T) {
  function TestColumns (line 128) | func TestColumns(t *testing.T) {
  function TestIndexes (line 219) | func TestIndexes(t *testing.T) {

FILE: drivers/metadata/reader.go
  type PluginReader (line 12) | type PluginReader struct
    method Catalogs (line 81) | func (p PluginReader) Catalogs(f Filter) (*CatalogSet, error) {
    method Schemas (line 88) | func (p PluginReader) Schemas(f Filter) (*SchemaSet, error) {
    method Tables (line 95) | func (p PluginReader) Tables(f Filter) (*TableSet, error) {
    method Columns (line 102) | func (p PluginReader) Columns(f Filter) (*ColumnSet, error) {
    method ColumnStats (line 109) | func (p PluginReader) ColumnStats(f Filter) (*ColumnStatSet, error) {
    method Indexes (line 116) | func (p PluginReader) Indexes(f Filter) (*IndexSet, error) {
    method IndexColumns (line 123) | func (p PluginReader) IndexColumns(f Filter) (*IndexColumnSet, error) {
    method Triggers (line 130) | func (p PluginReader) Triggers(f Filter) (*TriggerSet, error) {
    method Constraints (line 137) | func (p PluginReader) Constraints(f Filter) (*ConstraintSet, error) {
    method ConstraintColumns (line 144) | func (p PluginReader) ConstraintColumns(f Filter) (*ConstraintColumnSe...
    method Functions (line 151) | func (p PluginReader) Functions(f Filter) (*FunctionSet, error) {
    method FunctionColumns (line 158) | func (p PluginReader) FunctionColumns(f Filter) (*FunctionColumnSet, e...
    method Sequences (line 165) | func (p PluginReader) Sequences(f Filter) (*SequenceSet, error) {
    method PrivilegeSummaries (line 172) | func (p PluginReader) PrivilegeSummaries(f Filter) (*PrivilegeSummaryS...
  function NewPluginReader (line 32) | func NewPluginReader(readers ...Reader) Reader {
  type LoggingReader (line 179) | type LoggingReader struct
    method setLogger (line 243) | func (r *LoggingReader) setLogger(l logger) {
    method setDryRun (line 247) | func (r *LoggingReader) setDryRun(d bool) {
    method setTimeout (line 251) | func (r *LoggingReader) setTimeout(t time.Duration) {
    method Query (line 255) | func (r LoggingReader) Query(q string, v ...interface{}) (*sql.Rows, C...
  type logger (line 186) | type logger interface
  function NewLoggingReader (line 190) | func NewLoggingReader(db DB, opts ...ReaderOption) LoggingReader {
  type ReaderOption (line 201) | type ReaderOption
  function WithLogger (line 204) | func WithLogger(l logger) ReaderOption {
  function WithDryRun (line 211) | func WithDryRun(d bool) ReaderOption {
  function WithTimeout (line 218) | func WithTimeout(t time.Duration) ReaderOption {
  function WithLimit (line 225) | func WithLimit(l int) ReaderOption {
  type loggerSetter (line 233) | type loggerSetter interface
  type limiter (line 239) | type limiter interface
  type CloseFunc (line 273) | type CloseFunc

FILE: drivers/metadata/writer.go
  type DB (line 18) | type DB interface
  type DefaultWriter (line 30) | type DefaultWriter struct
    method DescribeFunctions (line 93) | func (w DefaultWriter) DescribeFunctions(u *dburl.URL, funcTypes, patt...
    method getFunctionColumns (line 151) | func (w DefaultWriter) getFunctionColumns(c, s, f string) (string, err...
    method DescribeTableDetails (line 178) | func (w DefaultWriter) DescribeTableDetails(u *dburl.URL, pattern stri...
    method describeTableDetails (line 253) | func (w DefaultWriter) describeTableDetails(typ, sp, tp string, verbos...
    method encodeWithSummary (line 279) | func (w DefaultWriter) encodeWithSummary(res tblfmt.ResultSet, params ...
    method tableDetailsSummary (line 293) | func (w DefaultWriter) tableDetailsSummary(sp, tp string) func(io.Writ...
    method describeTableTriggers (line 369) | func (w DefaultWriter) describeTableTriggers(out io.Writer, sp, tp str...
    method describeTableIndexes (line 394) | func (w DefaultWriter) describeTableIndexes(out io.Writer, sp, tp stri...
    method getIndexColumns (line 431) | func (w DefaultWriter) getIndexColumns(c, s, t, i string) (string, err...
    method describeTableConstraints (line 444) | func (w DefaultWriter) describeTableConstraints(out io.Writer, filter ...
    method getConstraintColumns (line 473) | func (w DefaultWriter) getConstraintColumns(c, s, t, n string) (string...
    method describeSequences (line 488) | func (w DefaultWriter) describeSequences(sp, tp string, verbose, showS...
    method describeIndex (line 518) | func (w DefaultWriter) describeIndex(i *Index) error {
    method ListAllDbs (line 548) | func (w DefaultWriter) ListAllDbs(u *dburl.URL, pattern string, verbos...
    method ListTables (line 568) | func (w DefaultWriter) ListTables(u *dburl.URL, tableTypes, pattern st...
    method ListSchemas (line 620) | func (w DefaultWriter) ListSchemas(u *dburl.URL, pattern string, verbo...
    method ListIndexes (line 644) | func (w DefaultWriter) ListIndexes(u *dburl.URL, pattern string, verbo...
    method ShowStats (line 692) | func (w DefaultWriter) ShowStats(u *dburl.URL, statTypes, pattern stri...
    method ListPrivilegeSummaries (line 776) | func (w DefaultWriter) ListPrivilegeSummaries(u *dburl.URL, pattern st...
  function NewDefaultWriter (line 42) | func NewDefaultWriter(r Reader, opts ...WriterOption) func(db DB, w io.W...
  type WriterOption (line 73) | type WriterOption
  function WithSystemSchemas (line 76) | func WithSystemSchemas(schemas []string) WriterOption {
  function WithListAllDbs (line 86) | func WithListAllDbs(f func(string, bool) error) WriterOption {
  function parsePattern (line 824) | func parsePattern(pattern string) (string, string, error) {
  function qualifiedIdentifier (line 833) | func qualifiedIdentifier(schema, name string) string {

FILE: drivers/moderncsqlite/moderncsqlite.go
  function init (line 19) | func init() {

FILE: drivers/mymysql/mymysql.go
  function init (line 17) | func init() {

FILE: drivers/mysql/mysql.go
  function init (line 21) | func init() {

FILE: drivers/netezza/netezza.go
  function init (line 17) | func init() {

FILE: drivers/odbc/odbc.go
  function init (line 17) | func init() {

FILE: drivers/oracle/oracle.go
  function init (line 16) | func init() {

FILE: drivers/oracle/orshared/orshared.go
  function Register (line 20) | func Register(name string, err func(error) (string, string), isPasswordE...

FILE: drivers/ots/ots.go
  function init (line 11) | func init() {

FILE: drivers/pgx/pgx.go
  function init (line 24) | func init() {
  type copyRows (line 133) | type copyRows struct
    method Next (line 138) | func (r *copyRows) Next() bool {
    method Values (line 142) | func (r *copyRows) Values() ([]interface{}, error) {
    method Err (line 151) | func (r *copyRows) Err() error {

FILE: drivers/postgres/postgres.go
  function init (line 27) | func init() {

FILE: drivers/presto/presto.go
  function init (line 13) | func init() {

FILE: drivers/ql/ql.go
  function init (line 11) | func init() {

FILE: drivers/qtype.go
  function QueryExecType (line 264) | func QueryExecType(prefix, sqlstr string) (string, bool) {

FILE: drivers/ramsql/ramsql.go
  function init (line 11) | func init() {

FILE: drivers/sapase/sapase.go
  function init (line 16) | func init() {

FILE: drivers/saphana/saphana.go
  function init (line 14) | func init() {

FILE: drivers/snowflake/snowflake.go
  function init (line 18) | func init() {
  function listAllDbs (line 50) | func listAllDbs(db drivers.DB, w io.Writer, _ string, _ bool) error {

FILE: drivers/spanner/spanner.go
  function init (line 11) | func init() {

FILE: drivers/sqlite3/sqlite3.go
  function init (line 16) | func init() {

FILE: drivers/sqlite3/sqshared/reader.go
  type MetadataReader (line 12) | type MetadataReader struct
    method SetLimit (line 32) | func (r *MetadataReader) SetLimit(l int) {
    method Columns (line 37) | func (r MetadataReader) Columns(f metadata.Filter) (*metadata.ColumnSe...
    method Tables (line 84) | func (r MetadataReader) Tables(f metadata.Filter) (*metadata.TableSet,...
    method Schemas (line 158) | func (r MetadataReader) Schemas(f metadata.Filter) (*metadata.SchemaSe...
    method Functions (line 190) | func (r MetadataReader) Functions(f metadata.Filter) (*metadata.Functi...
    method FunctionColumns (line 237) | func (r MetadataReader) FunctionColumns(metadata.Filter) (*metadata.Fu...
    method Indexes (line 241) | func (r MetadataReader) Indexes(f metadata.Filter) (*metadata.IndexSet...
    method IndexColumns (line 280) | func (r MetadataReader) IndexColumns(f metadata.Filter) (*metadata.Ind...
    method query (line 320) | func (r MetadataReader) query(qstr string, conds []string, order strin...
  function NewMetadataReader (line 18) | func NewMetadataReader(db drivers.DB, opts ...metadata.ReaderOption) met...

FILE: drivers/sqlite3/sqshared/reader_test.go
  function TestMain (line 27) | func TestMain(m *testing.M) {
  function createDb (line 42) | func createDb(location, name string) error {
  function TestSchemas (line 126) | func TestSchemas(t *testing.T) {
  function TestTables (line 143) | func TestTables(t *testing.T) {
  function TestColumns (line 160) | func TestColumns(t *testing.T) {
  function TestFunctions (line 177) | func TestFunctions(t *testing.T) {
  function TestIndexes (line 194) | func TestIndexes(t *testing.T) {
  function TestIndexColumns (line 211) | func TestIndexColumns(t *testing.T) {

FILE: drivers/sqlite3/sqshared/sqshared.go
  function ConvertBytes (line 14) | func ConvertBytes(buf []byte, tfmt string) (string, error) {
  type Time (line 30) | type Time
    method Value (line 33) | func (t *Time) Value() (driver.Value, error) {
    method Scan (line 38) | func (t *Time) Scan(v interface{}) error {
    method Parse (line 52) | func (t *Time) Parse(s string) error {

FILE: drivers/sqlserver/reader.go
  type metaReader (line 13) | type metaReader struct
    method SetLimit (line 87) | func (r *metaReader) SetLimit(l int) {
    method Catalogs (line 91) | func (r metaReader) Catalogs(metadata.Filter) (*metadata.CatalogSet, e...
    method Indexes (line 115) | func (r metaReader) Indexes(f metadata.Filter) (*metadata.IndexSet, er...
    method IndexColumns (line 170) | func (r metaReader) IndexColumns(f metadata.Filter) (*metadata.IndexCo...
    method query (line 228) | func (r metaReader) query(qstr string, conds []string, order string, v...
  function NewReader (line 22) | func NewReader(db drivers.DB, opts ...metadata.ReaderOption) metadata.Re...
  function dataTypeFormatter (line 54) | func dataTypeFormatter(col metadata.Column) string {

FILE: drivers/sqlserver/sqlserver.go
  function init (line 26) | func init() {
  function placeholder (line 95) | func placeholder(n int) string {
  type NullUniqueIdentifier (line 99) | type NullUniqueIdentifier struct
    method Scan (line 104) | func (nui *NullUniqueIdentifier) Scan(v interface{}) error {
    method String (line 116) | func (nui NullUniqueIdentifier) String() string {

FILE: drivers/sqlserver/sqlserver_test.go
  type Database (line 19) | type Database struct
  constant pw (line 35) | pw = "yourStrong123_Password"
  function TestMain (line 55) | func TestMain(m *testing.M) {
  function waitForDbConnection (line 115) | func waitForDbConnection(driver string, pool *dt.Pool, url string, port ...
  function TestColumns (line 131) | func TestColumns(t *testing.T) {

FILE: drivers/trino/reader.go
  type metaReader (line 11) | type metaReader struct
    method Catalogs (line 18) | func (r metaReader) Catalogs(metadata.Filter) (*metadata.CatalogSet, e...
    method ColumnStats (line 41) | func (r metaReader) ColumnStats(f metadata.Filter) (*metadata.ColumnSt...

FILE: drivers/trino/trino.go
  function init (line 16) | func init() {

FILE: drivers/vertica/vertica.go
  function init (line 24) | func init() {
  function addCA (line 84) | func addCA(name string, cfg *tls.Config) error {

FILE: drivers/voltdb/voltdb.go
  function init (line 11) | func init() {

FILE: drivers/ydb/ydb.go
  function init (line 15) | func init() {

FILE: env/env.go
  function init (line 28) | func init() {
  function Vars (line 33) | func Vars() *Variables {
  function Get (line 38) | func Get(name string) string {
  function Getenv (line 44) | func Getenv(keys ...string) (string, bool) {
  function Chdir (line 61) | func Chdir(u *user.User, path string) error {
  function OpenFile (line 72) | func OpenFile(u *user.User, path string) (string, *os.File, error) {
  function EditFile (line 98) | func EditFile(u *user.User, path, line string, buf []byte) ([]byte, erro...
  function HistoryFile (line 148) | func HistoryFile(u *user.User) string {
  function RCFile (line 161) | func RCFile(u *user.User) string {
  function Getshell (line 175) | func Getshell() (string, string) {
  function Shell (line 201) | func Shell(s string) error {
  function Pipe (line 219) | func Pipe(stdout, stderr io.Writer, c string) (io.WriteCloser, *exec.Cmd...
  function Exec (line 238) | func Exec(s string) (string, error) {
  function Unquote (line 258) | func Unquote(s string) (string, error) {
  function Untick (line 296) | func Untick(u *user.User, v *Variables, exec bool) func(string, bool) (s...
  function Quote (line 327) | func Quote(s string) string {
  function TermGraphics (line 334) | func TermGraphics() rasterm.TermType {
  function ValidIdentifier (line 342) | func ValidIdentifier(n string) error {
  function ParseBool (line 356) | func ParseBool(value, name string) (string, error) {
  function ParseKeywordBool (line 366) | func ParseKeywordBool(value, name string, keywords ...string) (string, e...

FILE: env/list.go
  function Listing (line 19) | func Listing(w io.Writer) error {
  function buildConfigDir (line 64) | func buildConfigDir(configName string) (string, string) {
  type varName (line 82) | type varName struct
    method String (line 87) | func (v varName) String() string {
  constant variableTpl (line 270) | variableTpl = `List of specially treated variables

FILE: env/vars.go
  type Variables (line 19) | type Variables struct
    method Vars (line 132) | func (v *Variables) Vars() map[string]string {
    method Print (line 137) | func (v *Variables) Print() map[string]string {
    method Conn (line 142) | func (v *Variables) Conn() map[string][]string {
    method Get (line 147) | func (v *Variables) Get(name string) (string, bool) {
    method Set (line 153) | func (v *Variables) Set(name, value string) error {
    method Unset (line 173) | func (v *Variables) Unset(name string) error {
    method Dump (line 182) | func (v *Variables) Dump(w io.Writer) error {
    method GetPrint (line 190) | func (v *Variables) GetPrint(name string) (string, error) {
    method SetPrint (line 198) | func (v *Variables) SetPrint(name, value string) (string, error) {
    method TogglePrint (line 253) | func (v *Variables) TogglePrint(name, extra string) (string, error) {
    method DumpPrint (line 307) | func (v *Variables) DumpPrint(w io.Writer) error {
    method PrintTimeFormat (line 330) | func (v *Variables) PrintTimeFormat() string {
    method SetConn (line 339) | func (v *Variables) SetConn(name string, vals ...string) error {
    method GetConn (line 352) | func (v *Variables) GetConn(name string) ([]string, bool) {
    method DumpConn (line 361) | func (v *Variables) DumpConn(w io.Writer) error {
  function NewVars (line 29) | func NewVars() *Variables {
  function NewDefaultVars (line 39) | func NewDefaultVars() *Variables {

FILE: gen.go
  function main (line 30) | func main() {
  function run (line 43) | func run(licenseStart int, licenseAuthor string, dburlGen bool, dburlDir...
  function loadDrivers (line 78) | func loadDrivers(wd string) error {
  function loadCommands (line 124) | func loadCommands(name string) error {
  function writeInternal (line 149) | func writeInternal(wd string, drivers ...map[string]DriverInfo) error {
  function writeReadme (line 199) | func writeReadme(dir string, includeTagSummary bool) error {
  function writeLicenseFiles (line 223) | func writeLicenseFiles(licenseStart int, licenseAuthor string) error {
  function writeDburlLicense (line 235) | func writeDburlLicense(dir string, licenseStart int, licenseAuthor strin...
  function writeCommands (line 243) | func writeCommands(name string) error {
  type DriverInfo (line 277) | type DriverInfo struct
  function parseDriverInfo (line 302) | func parseDriverInfo(tag, filename string) (DriverInfo, error) {
  type desc (line 367) | type desc struct
    method String (line 401) | func (d desc) String() string {
  function newDesc (line 376) | func newDesc(funcName, alias string, v []string) desc {
  function findCommand (line 406) | func findCommand(name string) string {
  function buildDriverTable (line 417) | func buildDriverTable(includeTagSummary bool) string {
  function buildRows (line 449) | func buildRows(m map[string]DriverInfo, widths []int) ([][]string, []int) {
  function buildAliases (line 484) | func buildAliases(v DriverInfo) string {
  function tableRows (line 508) | func tableRows(widths []int, c rune, rows ...[]string) string {
  function buildTableLinks (line 530) | func buildTableLinks(drivers ...map[string]DriverInfo) string {
  function getDburlDir (line 547) | func getDburlDir() string {
  function decodeCommand (line 557) | func decodeCommand(d ast.Decl) (string, []desc, bool, error) {
  function isCommand (line 576) | func isCommand(f *ast.FuncDecl) bool {
  function decodeCommandDoc (line 591) | func decodeCommandDoc(f *ast.FuncDecl) (string, []desc, error) {
  function decodeCommandDescs (line 612) | func decodeCommandDescs(funcName string, doc string) ([]desc, error) {
  constant driverTableStart (line 672) | driverTableStart = "<!-- DRIVER DETAILS START -->"
  constant driverTableEnd (line 673) | driverTableEnd   = "<!-- DRIVER DETAILS END -->"
  constant descsTpl (line 676) | descsTpl = `package metacmd
  constant internalTagGo (line 710) | internalTagGo = `//go:build %s
  constant internalGo (line 719) | internalGo = `// Package internal provides a way to obtain information a...
  constant licenseTextGo (line 732) | licenseTextGo = `package text
  constant license (line 740) | license = `The MIT License (MIT)

FILE: handler/handler.go
  type Handler (line 58) | type Handler struct
    method GetTiming (line 130) | func (h *Handler) GetTiming() bool {
    method SetTiming (line 135) | func (h *Handler) SetTiming(timing bool) {
    method SetSingleLineMode (line 140) | func (h *Handler) SetSingleLineMode(singleLineMode bool) {
    method Run (line 145) | func (h *Handler) Run() error {
    method apply (line 297) | func (h *Handler) apply(stdout, stderr io.Writer, cmd, paramstr string...
    method outputHighlighter (line 336) | func (h *Handler) outputHighlighter(s string) string {
    method Execute (line 434) | func (h *Handler) Execute(ctx context.Context, w io.Writer, opt metacm...
    method Reset (line 474) | func (h *Handler) Reset(r []rune) {
    method Bind (line 480) | func (h *Handler) Bind(bind []interface{}) {
    method unbind (line 485) | func (h *Handler) unbind() []interface{} {
    method Prompt (line 567) | func (h *Handler) Prompt(prompt string) string {
    method IO (line 696) | func (h *Handler) IO() rline.IO {
    method User (line 701) | func (h *Handler) User() *user.User {
    method URL (line 706) | func (h *Handler) URL() *dburl.URL {
    method DB (line 711) | func (h *Handler) DB() drivers.DB {
    method LastExec (line 719) | func (h *Handler) LastExec() string {
    method LastPrint (line 724) | func (h *Handler) LastPrint() string {
    method LastRaw (line 729) | func (h *Handler) LastRaw() string {
    method Buf (line 734) | func (h *Handler) Buf() *stmt.Stmt {
    method Highlight (line 739) | func (h *Handler) Highlight(w io.Writer, buf string) error {
    method Open (line 766) | func (h *Handler) Open(ctx context.Context, params ...string) error {
    method connStrings (line 830) | func (h *Handler) connStrings() []string {
    method forceParams (line 870) | func (h *Handler) forceParams(u *dburl.URL) {
    method Password (line 888) | func (h *Handler) Password(dsn string) (string, error) {
    method Close (line 914) | func (h *Handler) Close() error {
    method ReadVar (line 929) | func (h *Handler) ReadVar(typ, prompt string) (string, error) {
    method ChangePassword (line 976) | func (h *Handler) ChangePassword(user string) (string, error) {
    method Version (line 1016) | func (h *Handler) Version(ctx context.Context) error {
    method Print (line 1035) | func (h *Handler) Print(s string, v ...interface{}) {
    method doExecWatch (line 1043) | func (h *Handler) doExecWatch(ctx context.Context, w io.Writer, opt me...
    method doExecChart (line 1064) | func (h *Handler) doExecChart(ctx context.Context, w io.Writer, opt me...
    method doExecSingle (line 1140) | func (h *Handler) doExecSingle(ctx context.Context, w io.Writer, opt m...
    method doExecSet (line 1165) | func (h *Handler) doExecSet(ctx context.Context, w io.Writer, opt meta...
    method doExecExec (line 1205) | func (h *Handler) doExecExec(ctx context.Context, w io.Writer, _ metac...
    method doQuery (line 1225) | func (h *Handler) doQuery(ctx context.Context, w io.Writer, opt metacm...
    method doExecRows (line 1302) | func (h *Handler) doExecRows(ctx context.Context, w io.Writer, rows *s...
    method scan (line 1331) | func (h *Handler) scan(rows *sql.Rows, clen int, tfmt string) ([]strin...
    method doExec (line 1386) | func (h *Handler) doExec(ctx context.Context, w io.Writer, _ metacmd.O...
    method Begin (line 1411) | func (h *Handler) Begin(txOpts *sql.TxOptions) error {
    method BeginTx (line 1416) | func (h *Handler) BeginTx(ctx context.Context, txOpts *sql.TxOptions) ...
    method Commit (line 1432) | func (h *Handler) Commit() error {
    method Rollback (line 1448) | func (h *Handler) Rollback() error {
    method If (line 1464) | func (h *Handler) If(ok bool) error {
    method ElseIf (line 1469) | func (h *Handler) ElseIf(ok bool) error {
    method Else (line 1474) | func (h *Handler) Else(bool) error {
    method EndIf (line 1479) | func (h *Handler) EndIf(bool) error {
    method IncludeReader (line 1484) | func (h *Handler) IncludeReader(rdr io.Reader, path string) error {
    method Include (line 1530) | func (h *Handler) Include(path string, relative bool) error {
    method MetadataWriter (line 1545) | func (h *Handler) MetadataWriter(ctx context.Context) (metadata.Writer...
    method GetOutput (line 1553) | func (h *Handler) GetOutput() io.Writer {
    method SetOutput (line 1561) | func (h *Handler) SetOutput(o io.WriteCloser) {
  function New (line 100) | func New(l rline.IO, user *user.User, wd string, charts billy.Filesystem...
  type FS (line 1569) | type FS interface
  type Error (line 1572) | type Error struct
    method Error (line 1590) | func (e *Error) Error() string {
    method Unwrap (line 1595) | func (e *Error) Unwrap() error {
  function WrapErr (line 1578) | func WrapErr(buf string, err error) error {
  function readerOpts (line 1599) | func readerOpts() []metadata.ReaderOption {
  function peekEnding (line 1617) | func peekEnding(w io.Writer, r *bufio.Reader) error {
  function grab (line 1648) | func grab(r []rune, i, end int) rune {
  function empty (line 1657) | func empty(s string) bool {
  function lastcolor (line 1664) | func lastcolor(s string) string {
  function isSpaceOrControl (line 1675) | func isSpaceOrControl(r rune) bool {
  function lastIndex (line 1680) | func lastIndex(r []rune, needle rune) int {

FILE: internal/internal.go
  function KnownBuildTags (line 9) | func KnownBuildTags() map[string]string {

FILE: internal/z.go
  function init (line 10) | func init() {

FILE: main.go
  function main (line 23) | func main() {

FILE: metacmd/charts/charts.go
  type ChartConfig (line 15) | type ChartConfig struct
  function ParseArgs (line 26) | func ParseArgs(opts map[string]string) (ChartConfig, error) {
  type Chart (line 70) | type Chart struct
    method ToEcharts (line 176) | func (c Chart) ToEcharts() (string, error) {
  type Series (line 79) | type Series struct
  function MakeChart (line 85) | func MakeChart(cfg ChartConfig, cols []string, transposed [][]string) (*...
  type echarts (line 153) | type echarts struct
  type echartsTitle (line 161) | type echartsTitle struct
  type echartsLegend (line 166) | type echartsLegend struct
  type echartsAxis (line 170) | type echartsAxis struct
  function parseFloat (line 215) | func parseFloat(v string, prec int) (f float64, err error) {
  constant basicBarTemplate (line 224) | basicBarTemplate = `

FILE: metacmd/cmds.go
  function Quit (line 29) | func Quit(p *Params) error {
  function Copyright (line 40) | func Copyright(p *Params) error {
  function Drivers (line 55) | func Drivers(p *Params) error {
  function Help (line 102) | func Help(p *Params) error {
  function Execute (line 145) | func Execute(p *Params) error {
  function Bind (line 177) | func Bind(p *Params) error {
  function Timing (line 199) | func Timing(p *Params) error {
  function Crosstab (line 235) | func Crosstab(p *Params) error {
  function Chart (line 256) | func Chart(p *Params) error {
  function Watch (line 291) | func Watch(p *Params) error {
  function Connect (line 320) | func Connect(p *Params) error {
  function Disconnect (line 337) | func Disconnect(p *Params) error {
  function Password (line 348) | func Password(p *Params) error {
  function ConnectionInfo (line 370) | func ConnectionInfo(p *Params) error {
  function Edit (line 386) | func Edit(p *Params) error {
  function Print (line 434) | func Print(p *Params) error {
  function Write (line 471) | func Write(p *Params) error {
  function Reset (line 491) | func Reset(p *Params) error {
  function Echo (line 505) | func Echo(p *Params) error {
  function Out (line 542) | func Out(p *Params) error {
  function Copy (line 571) | func Copy(p *Params) error {
  function Include (line 633) | func Include(p *Params) error {
  function Transact (line 655) | func Transact(p *Params) error {
  function Set (line 711) | func Set(p *Params) error {
  function Unset (line 730) | func Unset(p *Params) error {
  function SetPrint (line 751) | func SetPrint(p *Params) error {
  function SetConn (line 830) | func SetConn(p *Params) error {
  function Prompt (line 850) | func Prompt(p *Params) error {
  function Describe (line 897) | func Describe(p *Params) error {
  function Stats (line 939) | func Stats(p *Params) error {
  function Conditional (line 982) | func Conditional(p *Params) error {
  function Shell (line 998) | func Shell(p *Params) error {
  function Chdir (line 1008) | func Chdir(p *Params) error {
  function Getenv (line 1023) | func Getenv(p *Params) error {
  function Setenv (line 1049) | func Setenv(p *Params) error {

FILE: metacmd/descs.go
  function init (line 31) | func init() {

FILE: metacmd/metacmd.go
  type Handler (line 25) | type Handler interface
  function Dump (line 79) | func Dump(w io.Writer, hidden bool) error {
  function Decode (line 103) | func Decode(name string, params *stmt.Params) (func(Handler) (Option, er...
  type Params (line 120) | type Params struct
    method Next (line 132) | func (p *Params) Next(exec bool) (string, error) {
    method NextOK (line 145) | func (p *Params) NextOK(exec bool) (string, bool, error) {
    method NextOpt (line 156) | func (p *Params) NextOpt(exec bool) (string, bool, error) {
    method All (line 168) | func (p *Params) All(exec bool) ([]string, error) {
    method Raw (line 180) | func (p *Params) Raw() string {
  type Option (line 185) | type Option struct
    method ParseParams (line 198) | func (opt *Option) ParseParams(params []string, defaultKey string) err...
  type ExecType (line 228) | type ExecType
  constant ExecNone (line 232) | ExecNone ExecType = iota
  constant ExecOnly (line 234) | ExecOnly
  constant ExecPipe (line 236) | ExecPipe
  constant ExecSet (line 239) | ExecSet
  constant ExecExec (line 241) | ExecExec
  constant ExecCrosstab (line 243) | ExecCrosstab
  constant ExecChart (line 245) | ExecChart
  constant ExecWatch (line 247) | ExecWatch
  type desc (line 251) | type desc struct
    method Names (line 261) | func (d desc) Names() []string {
  function wrap (line 279) | func wrap(s string, width, prefixWidth int) string {

FILE: rline/rline.go
  type IO (line 20) | type IO interface
  type Rline (line 46) | type Rline struct
    method Next (line 61) | func (l *Rline) Next() ([]rune, error) {
    method Close (line 69) | func (l *Rline) Close() error {
    method Stdout (line 77) | func (l *Rline) Stdout() io.Writer {
    method Stderr (line 82) | func (l *Rline) Stderr() io.Writer {
    method Interactive (line 87) | func (l *Rline) Interactive() bool {
    method Cygwin (line 92) | func (l *Rline) Cygwin() bool {
    method Prompt (line 97) | func (l *Rline) Prompt(s string) {
    method Completer (line 104) | func (l *Rline) Completer(a readline.AutoCompleter) {
    method Save (line 111) | func (l *Rline) Save(s string) error {
    method Password (line 119) | func (l *Rline) Password(prompt string) (string, error) {
    method SetOutput (line 127) | func (l *Rline) SetOutput(f func(string) string) {
  function New (line 132) | func New(interactive, cygwin, forceNonInteractive bool, out, histfile st...

FILE: run.go
  type ContextExecutor (line 27) | type ContextExecutor interface
  function New (line 32) | func New(cliargs []string) ContextExecutor {
  function Run (line 220) | func Run(ctx context.Context, args *Args) error {
  type Args (line 363) | type Args struct
  type CommandOrFile (line 382) | type CommandOrFile struct
  type commandOrFile (line 389) | type commandOrFile struct
    method Set (line 395) | func (c commandOrFile) Set(value string) error {
    method String (line 404) | func (c commandOrFile) String() string {
    method Type (line 409) | func (c commandOrFile) Type() string {
  type vs (line 417) | type vs struct
    method Set (line 424) | func (p vs) Set(value string) error {
    method String (line 440) | func (vs) String() string {
    method Type (line 445) | func (p vs) Type() string {
  type filevar (line 453) | type filevar struct
    method Set (line 458) | func (p filevar) Set(value string) error {
    method String (line 464) | func (filevar) String() string {
    method Type (line 469) | func (filevar) Type() string {
  function chartsFS (line 474) | func chartsFS(v *viper.Viper) (billy.Filesystem, error) {
  function setConn (line 506) | func setConn(name string, value interface{}) error {
  function runCommandOrFiles (line 523) | func runCommandOrFiles(h *handler.Handler, commandsOrFiles []CommandOrFi...
  function sf (line 543) | func sf(flags *pflag.FlagSet, v *[]string, name, short, usage, placehold...
  function convSlice (line 551) | func convSlice(v []interface{}) []string {

FILE: stmt/params.go
  type Params (line 10) | type Params struct
    method Raw (line 26) | func (p *Params) Raw() string {
    method Next (line 35) | func (p *Params) Next(unquote func(string, bool) (string, bool, error)...
    method All (line 91) | func (p *Params) All(unquote func(string, bool) (string, bool, error))...
    method Arg (line 108) | func (p *Params) Arg() (string, bool, error) {
  function NewParams (line 16) | func NewParams(params string) *Params {

FILE: stmt/params_test.go
  function TestParamsGetRaw (line 13) | func TestParamsGetRaw(t *testing.T) {
  function TestParamsGetAll (line 41) | func TestParamsGetAll(t *testing.T) {
  function testUnquote (line 116) | func testUnquote(t *testing.T, u *user.User) func(string, bool) (string,...

FILE: stmt/parse.go
  constant prefixCount (line 9) | prefixCount = 6
  constant maxVarNameLen (line 12) | maxVarNameLen = 128
  function grab (line 15) | func grab(r []rune, i, end int) rune {
  function findSpace (line 23) | func findSpace(r []rune, i, end int) (int, bool) {
  function findNonSpace (line 33) | func findNonSpace(r []rune, i, end int) (int, bool) {
  function findRune (line 43) | func findRune(r []rune, i, end int, c rune) (int, bool) {
  function isEmptyLine (line 53) | func isEmptyLine(r []rune, i, end int) bool {
  function readDollarAndTag (line 63) | func readDollarAndTag(r []rune, i, end int) (string, int, bool) {
  function readString (line 91) | func readString(r []rune, i, end int, quote rune, tag string) (int, bool) {
  function readMultilineComment (line 118) | func readMultilineComment(r []rune, i, end int) (int, bool) {
  function readVar (line 130) | func readVar(r []rune, i, end int, next rune) *Var {
  function readVarName (line 163) | func readVarName(r []rune, i, end int, q rune) (int, rune) {
  function readCommand (line 179) | func readCommand(r []rune, i, end int) (int, int) {
  function findPrefix (line 218) | func findPrefix(r []rune, n int, allowCComments, allowHashComments, allo...
  function FindPrefix (line 285) | func FindPrefix(s string, allowCComments, allowHashComments, allowMultil...
  function substitute (line 291) | func substitute(r []rune, i, end, n int, s string) ([]rune, int) {
  function appendUpperRunes (line 311) | func appendUpperRunes(s []rune, r []rune, extra ...rune) []rune {

FILE: stmt/parse_test.go
  function TestGrab (line 10) | func TestGrab(t *testing.T) {
  function TestFindSpace (line 33) | func TestFindSpace(t *testing.T) {
  function TestFindNonSpace (line 64) | func TestFindNonSpace(t *testing.T) {
  function TestIsEmptyLine (line 97) | func TestIsEmptyLine(t *testing.T) {
  function TestReadString (line 126) | func TestReadString(t *testing.T) {
  function TestReadCommand (line 193) | func TestReadCommand(t *testing.T) {
  function TestFindPrefix (line 262) | func TestFindPrefix(t *testing.T) {
  function TestReadVar (line 335) | func TestReadVar(t *testing.T) {
  function TestSubstitute (line 450) | func TestSubstitute(t *testing.T) {

FILE: stmt/stmt.go
  constant minCapIncrease (line 10) | minCapIncrease = 512
  type Stmt (line 14) | type Stmt struct
    method String (line 62) | func (b *Stmt) String() string {
    method PrintString (line 68) | func (b *Stmt) PrintString() string {
    method RawString (line 92) | func (b *Stmt) RawString() string {
    method Ready (line 117) | func (b *Stmt) Ready() bool {
    method Reset (line 122) | func (b *Stmt) Reset(r []rune) {
    method Next (line 172) | func (b *Stmt) Next(unquote func(string, bool) (string, bool, error)) ...
    method Append (line 319) | func (b *Stmt) Append(r, sep []rune) {
    method AppendString (line 343) | func (b *Stmt) AppendString(s, sep string) {
    method State (line 348) | func (b *Stmt) State() string {
  function New (line 50) | func New(f func() ([]rune, error), opts ...Option) *Stmt {
  type Var (line 363) | type Var struct
    method String (line 381) | func (v *Var) String() string {
    method Substitute (line 394) | func (v *Var) Substitute(r []rune, s string, ok bool) ([]rune, int) {
  type Option (line 420) | type Option
  function WithAllowDollar (line 424) | func WithAllowDollar(enable bool) Option {
  function WithAllowMultilineComments (line 432) | func WithAllowMultilineComments(enable bool) Option {
  function WithAllowCComments (line 440) | func WithAllowCComments(enable bool) Option {
  function WithAllowHashComments (line 448) | func WithAllowHashComments(enable bool) Option {
  function isSpaceOrControl (line 456) | func isSpaceOrControl(r rune) bool {
  function lastIndex (line 461) | func lastIndex(r []rune, needle rune) int {
  function trueFalse (line 471) | func trueFalse(ok bool) string {

FILE: stmt/stmt_test.go
  function TestAppend (line 14) | func TestAppend(t *testing.T) {
  function TestVariedSeparator (line 70) | func TestVariedSeparator(t *testing.T) {
  function TestNextResetState (line 85) | func TestNextResetState(t *testing.T) {
  function TestEmptyVariablesRawString (line 296) | func TestEmptyVariablesRawString(t *testing.T) {
  function TestVarSubstitute (line 318) | func TestVarSubstitute(t *testing.T) {
  function v (line 396) | func v(i int, name string, x ...string) *Var {
  function cc (line 415) | func cc(cmds []string, params []string) []string {
  function sp (line 429) | func sp(a, sep string) func() ([]rune, error) {
  function sl (line 441) | func sl(n int, r rune) string {

FILE: styles/styles.go
  function Get (line 21) | func Get(name string) *chroma.Style {

FILE: testcli.go
  function main (line 20) | func main() {
  function run (line 32) | func run(ctx context.Context, binpath string, deadline, timeout time.Dur...
  type Test (line 60) | type Test struct
    method do (line 115) | func (test Test) do(ctx context.Context, binpath string, timeout time....
  function cliTests (line 67) | func cliTests() ([]Test, error) {
  type noopWriteCloser (line 144) | type noopWriteCloser struct
    method Close (line 148) | func (*noopWriteCloser) Close() error {

FILE: testdata/copy.sql
  type a_bit_of_everything (line 8) | create table a_bit_of_everything (
  type a_bit_of_everything (line 30) | create table a_bit_of_everything (
  type a_bit_of_everything (line 45) | create table a_bit_of_everything (
  type a_bit_of_everything (line 60) | create table a_bit_of_everything (

FILE: text/license.go
  constant License (line 6) | License = `The MIT License (MIT)

FILE: text/text.go
  function init (line 129) | func init() {
  function Usage (line 169) | func Usage(w io.Writer, banner bool) {
  function init (line 184) | func init() {
Condensed preview — 268 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,286K chars).
[
  {
    "path": ".github/dependabot.yml",
    "chars": 175,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      # Check for updates t"
  },
  {
    "path": ".github/workflows/announce.yml",
    "chars": 5680,
    "preview": "name: Announce Release\non:\n  release:\n    types: [published]\nenv:\n  VER: ${{ github.ref_name }}\n  AUTHOR_NAME: Kenneth S"
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 7863,
    "preview": "name: Release\non: push\nenv:\n  APP: usql\n  VER: ${{ github.ref_name }}\n  GO_VERSION: stable\n\njobs:\n  build_for_linux:\n   "
  },
  {
    "path": ".github/workflows/test.yml",
    "chars": 1528,
    "preview": "on: [push, pull_request]\nname: Test usql\njobs:\n  test:\n    name: Build and Test usql\n    runs-on: ubuntu-latest\n    serv"
  },
  {
    "path": ".gitignore",
    "chars": 186,
    "preview": "/usql\n/usql.exe\n/build/\n/coverage.out\n/*.sql\n/*.txt\n\n.usql_history*\n.[a-f0-9]*\n\n*.ini\n*.csv\n*.db\n*.zip\n*.out\n\n*.sqlite3\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 3091,
    "preview": "Contributing to usql\n====================\n\nAny contributions are welcome. If you found a bug, or a missing feature,\ntake"
  },
  {
    "path": "LICENSE",
    "chars": 1084,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2015-2025 Kenneth Shaw\n\nPermission is hereby granted, free of charge, to any person"
  },
  {
    "path": "README.md",
    "chars": 66401,
    "preview": "<div align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/xo/usql-logo/master/usql.png\" height=\"120\">\n</div>\n\n<"
  },
  {
    "path": "build.sh",
    "chars": 4969,
    "preview": "#!/bin/bash\n\nset -e\n\nSRC=$(realpath $(cd -P \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd))\n\nNAME=$(basename $SRC)\nVER=\nSTATIC"
  },
  {
    "path": "contrib/adodb/adodb.sh",
    "chars": 290,
    "preview": "#!/bin/bash\n\nrm -f example.csv\n\nusql \"adodb://Microsoft.ACE.OLEDB.12.0/?Extended+Properties=\\\"Text;HDR=NO;FMT=Delimited\\"
  },
  {
    "path": "contrib/adodb/usql-config",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "contrib/cassandra/podman-config",
    "chars": 64,
    "preview": "NAME=cassandra\nIMAGE=docker.io/usql/cassandra\nPUBLISH=9042:9042\n"
  },
  {
    "path": "contrib/cassandra/test.sql",
    "chars": 44740,
    "preview": "USE cycling;\nCREATE KEYSPACE IF NOT EXISTS cycling WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor'"
  },
  {
    "path": "contrib/cassandra/usql-config",
    "chars": 127,
    "preview": "DB=\"cassandra://cassandra:cassandra@localhost\"\nVSQL=\"SELECT release_version AS version FROM system.local WHERE key = 'lo"
  },
  {
    "path": "contrib/charts/area_density_stacked.vl.json",
    "chars": 545,
    "preview": "{\n  \"$schema\": \"https://vega.github.io/schema/vega-lite/v5.json\",\n  \"title\": \"{{ header }}\",\n  \"width\": 400,\n  \"height\":"
  },
  {
    "path": "contrib/charts/penguins.json",
    "chars": 67119,
    "preview": "[\n  {\n    \"Species\": \"Adelie\",\n    \"Island\": \"Torgersen\",\n    \"Beak Length (mm)\": 39.1,\n    \"Beak Depth (mm)\": 18.7,\n   "
  },
  {
    "path": "contrib/clickhouse/podman-config",
    "chars": 180,
    "preview": "NAME=clickhouse\nIMAGE=docker.io/clickhouse/clickhouse-server\nPUBLISH=9000:9000\nENV=\"CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT"
  },
  {
    "path": "contrib/clickhouse/usql-config",
    "chars": 84,
    "preview": "DB=\"clickhouse://clickhouse:P4ssw0rd@localhost\"\nVSQL=\"select version() as version;\"\n"
  },
  {
    "path": "contrib/cockroach/podman-config",
    "chars": 190,
    "preview": "NAME=cockroach\nIMAGE=docker.io/cockroachdb/cockroach:latest\nPUBLISH=26257:26257\nENV=\"COCKROACH_DATABASE=cockroach COCKRO"
  },
  {
    "path": "contrib/config.yaml",
    "chars": 1483,
    "preview": "---\n# named connections\nconnections:\n  my_couchbase_conn: couchbase://Administrator:P4ssw0rd@localhost\n  my_clickhouse_c"
  },
  {
    "path": "contrib/couchbase/README.md",
    "chars": 179,
    "preview": "# Couchbase Notes\n\n```sh\n$ podman volume create couchbase-data\n```\n\nAfter running the docker image, browse to http://127"
  },
  {
    "path": "contrib/couchbase/podman-config",
    "chars": 118,
    "preview": "NAME=couchbase\nIMAGE=docker.io/library/couchbase\nPUBLISH=8091-8094:8091-8094\nVOLUME=couchbase-data:/opt/couchbase/var\n"
  },
  {
    "path": "contrib/couchbase/usql-config",
    "chars": 175,
    "preview": "# NOTE: this will only work after setting up a database on http://localhost:8091/\nDB=\"couchbase://Administrator:P4ssw0rd"
  },
  {
    "path": "contrib/db2/README.md",
    "chars": 616,
    "preview": "# db2 Notes\n\n1. Install unixodbc:\n\n```sh\n$ sudo aptitude install unixodbc unixodbc-bin unixodbc-dev\n$ yay -S unixodbc\n``"
  },
  {
    "path": "contrib/db2/db2cli-validate.sh",
    "chars": 618,
    "preview": "#!/bin/bash\n\n# see https://www.ibm.com/developerworks/community/blogs/ff78a96f-bf23-457e-befa-77f266844cbb/entry/db2cli_"
  },
  {
    "path": "contrib/db2/db2dsdriver.cfg",
    "chars": 246,
    "preview": "<configuration>\n  <dsncollection>\n    <dsn alias=\"SAMPLE\" name=\"SAMPLE\" host=\"localhost\" port=\"50000\"> </dsn>\n  </dsncol"
  },
  {
    "path": "contrib/db2/install-dsdriver.sh",
    "chars": 739,
    "preview": "#!/bin/bash\n\nDEST=${1:-/opt/db2}\nFILE=$2\n\nif [ ! -w $DEST ]; then\n  echo \"ERROR: not able to write to $DEST\"\n  exit 1\nfi"
  },
  {
    "path": "contrib/db2/podman-config",
    "chars": 183,
    "preview": "NAME=db2\nIMAGE=icr.io/db2_community/db2\nPUBLISH=\"50000:50000 55000:55000\"\nENV=\"LICENSE=accept DB2INSTANCE=db2inst1 DB2IN"
  },
  {
    "path": "contrib/db2/test.sql",
    "chars": 472,
    "preview": "\\connect odbc+db2://db2inst1:P4ssw0rd@localhost/testdb\n\ncreate schema test;\n\ncreate table test.mytable (\n  COL1 INTEGER "
  },
  {
    "path": "contrib/db2/usql-config",
    "chars": 120,
    "preview": "DB=\"odbc+db2://db2inst1:P4ssw0rd@localhost/testdb\"\nVSQL=\"SELECT service_level AS version FROM sysibmadm.env_inst_info;\"\n"
  },
  {
    "path": "contrib/duckdb/usql-config",
    "chars": 88,
    "preview": "DB=\"duckdb:test.duckdb\"\nVSQL=\"SELECT library_version AS version FROM pragma_version();\"\n"
  },
  {
    "path": "contrib/exasol/podman-config",
    "chars": 63,
    "preview": "NAME=exasol\nIMAGE=docker.io/exasol/docker-db\nPUBLISH=8563:8563\n"
  },
  {
    "path": "contrib/exasol/usql-config",
    "chars": 149,
    "preview": "DB=\"exasol://sys:exasol@localhost/?encryption=0\"\nVSQL=\"SELECT param_value AS version FROM exa_metadata WHERE param_name "
  },
  {
    "path": "contrib/firebird/podman-config",
    "chars": 153,
    "preview": "NAME=firebird\nIMAGE=docker.io/jacobalberty/firebird\nPUBLISH=3050:3050\nENV=\"FIREBIRD_DATABASE=booktest FIREBIRD_USER=book"
  },
  {
    "path": "contrib/firebird/usql-config",
    "chars": 143,
    "preview": "DB=\"firebird://booktest:booktest@localhost/booktest\"\nVSQL=\"SELECT rdb\\$get_context('SYSTEM', 'ENGINE_VERSION') AS versio"
  },
  {
    "path": "contrib/flightsql/podman-config",
    "chars": 105,
    "preview": "NAME=flightsql\nIMAGE=docker.io/voltrondata/flight-sql\nPUBLISH=31337:31337\nENV=\"FLIGHT_PASSWORD=P4ssw0rd\"\n"
  },
  {
    "path": "contrib/flightsql/usql-config",
    "chars": 110,
    "preview": "DB=\"flightsql://flight_username:P4ssw0rd@localhost:31337?tls=skip-verify\"\nVSQL=\"SELECT version() AS version;\"\n"
  },
  {
    "path": "contrib/go-setup.sh",
    "chars": 1781,
    "preview": "#!/bin/bash\n\n# trimmed down version of:\n# https://github.com/kenshaw/shell-config/blob/master/scripts/go-setup.sh\n\nARCH="
  },
  {
    "path": "contrib/godror/fix-oob-config.sh",
    "chars": 252,
    "preview": "#!/bin/bash\n\n# adds DISABLE_OOB=on to user's .sqlnet.ora config\n#\n# See:\n#   https://github.com/oracle/docker-images/iss"
  },
  {
    "path": "contrib/godror/grab-instantclient.sh",
    "chars": 2537,
    "preview": "#!/bin/bash\n\nDEST=${1:-/opt/oracle}\n\n# available versions:\n# 21.7.0.0.0\n# 21.6.0.0.0\n# 21.1.0.0.0\n# 19.9.0.0.0\n# 18.5.0."
  },
  {
    "path": "contrib/godror/usql-config",
    "chars": 86,
    "preview": "DB=\"godror://system:P4ssw0rd@localhost/orasid\"\nVSQL=\"SELECT version FROM v\\$instance\"\n"
  },
  {
    "path": "contrib/h2/podman-config",
    "chars": 72,
    "preview": "NAME=h2\nIMAGE=docker.io/buildo/h2database\nPUBLISH=\"8082:8082 9092:9092\"\n"
  },
  {
    "path": "contrib/hive/podman-config",
    "chars": 116,
    "preview": "NAME=hive\nIMAGE=docker.io/apache/hive:4.0.0-beta-1\nPUBLISH=\"10000:10000 10002:10002\"\nENV=\"SERVICE_NAME=hiveserver2\"\n"
  },
  {
    "path": "contrib/hive/usql-config",
    "chars": 68,
    "preview": "DB=\"hive://user:pass@localhost\"\nVSQL=\"SELECT version() AS version;\"\n"
  },
  {
    "path": "contrib/ignite/README.md",
    "chars": 91,
    "preview": "# Ignite Notes\n\nAfter starting the database, run `activate.sh`:\n\n```sh\n$ ./activate.sh\n```\n"
  },
  {
    "path": "contrib/ignite/activate.sh",
    "chars": 136,
    "preview": "#!/bin/bash\n\ndocker exec -it ignite \\\n  /opt/ignite/apache-ignite/bin/control.sh \\\n  --activate \\\n  --user ignite \\\n  --"
  },
  {
    "path": "contrib/ignite/podman-config",
    "chars": 73,
    "preview": "NAME=ignite\nIMAGE=docker.io/usql/ignite\nPUBLISH=10800:10800\nNETWORK=host\n"
  },
  {
    "path": "contrib/ignite/usql-config",
    "chars": 48,
    "preview": "DB=\"ignite://ignite:ignite@localhost/ExampleDB\"\n"
  },
  {
    "path": "contrib/mymysql/usql-config",
    "chars": 76,
    "preview": "DB=\"mymysql://root:P4ssw0rd@localhost/\"\nVSQL=\"SELECT version() AS version;\"\n"
  },
  {
    "path": "contrib/mysql/podman-config",
    "chars": 96,
    "preview": "NAME=mysql\nIMAGE=docker.io/library/mariadb\nPUBLISH=3306:3306\nENV=\"MYSQL_ROOT_PASSWORD=P4ssw0rd\"\n"
  },
  {
    "path": "contrib/mysql/test.sql",
    "chars": 1960,
    "preview": "-- mysql test script\n\n\\set\n\n\\set SYNTAX_HL_FORMAT terminal16m\n\\set SYNTAX_HL true\n\n\\?\n\n\\copyright\n\n\\set SYNTAX_HL_STYLE "
  },
  {
    "path": "contrib/mysql/usql-config",
    "chars": 74,
    "preview": "DB=\"mysql://root:P4ssw0rd@localhost/\"\nVSQL=\"SELECT version() AS version;\"\n"
  },
  {
    "path": "contrib/oracle/init.sql",
    "chars": 684,
    "preview": "\\set ORACLE_USER system\n\\set ORACLE_PASS oracle\n\\set ORACLE_SVC xe\n\\set ORACLE_HOST `docker port oracle 1521`\n\n\\prompt N"
  },
  {
    "path": "contrib/oracle/podman-config",
    "chars": 165,
    "preview": "NAME=oracle\nIMAGE=container-registry.oracle.com/database/free\nPUBLISH=1521:1521\nENV=\"ORACLE_PDB=db1 ORACLE_PWD=P4ssw0rd\""
  },
  {
    "path": "contrib/oracle/usql-config",
    "chars": 84,
    "preview": "DB=\"oracle://system:P4ssw0rd@localhost/free\"\nVSQL=\"SELECT version FROM v\\$instance\"\n"
  },
  {
    "path": "contrib/oracle-enterprise/podman-config",
    "chars": 197,
    "preview": "NAME=oracle-enterprise\nIMAGE=container-registry.oracle.com/database/enterprise:21.3.0.0\nPUBLISH=1522:1521\nENV=\"ORACLE_PD"
  },
  {
    "path": "contrib/oracle-enterprise/usql-config",
    "chars": 88,
    "preview": "DB=\"oracle://system:P4ssw0rd@localhost:1522/db1\"\nVSQL=\"SELECT version FROM v\\$instance\"\n"
  },
  {
    "path": "contrib/pgx/usql-config",
    "chars": 118,
    "preview": "DB=\"pgx://postgres:P4ssw0rd@localhost\"\nVSQL=\"SELECT setting AS version FROM pg_settings WHERE name='server_version';\"\n"
  },
  {
    "path": "contrib/podman-run.sh",
    "chars": 3144,
    "preview": "#!/bin/bash\n\n# podman-run.sh: starts or restarts podman containers.\n#\n# Usage: podman-run.sh <TARGET> [-u]\n#\n# Where <ta"
  },
  {
    "path": "contrib/podman-stop.sh",
    "chars": 382,
    "preview": "#!/bin/bash\n\nSRC=$(realpath $(cd -P \"$(dirname \"${BASH_SOURCE[0]}\" )\" && pwd))\n\nfor TARGET in $SRC/*/podman-config; do\n "
  },
  {
    "path": "contrib/postgres/init.sql",
    "chars": 469,
    "preview": "\\set POSTGRES_USER postgres\n\\set POSTGRES_PASS P4ssw0rd\n\\set POSTGRES_DB   postgres\n\\set POSTGRES_HOST `docker port post"
  },
  {
    "path": "contrib/postgres/podman-config",
    "chars": 95,
    "preview": "NAME=postgres\nIMAGE=docker.io/usql/postgres\nPUBLISH=5432:5432\nENV=\"POSTGRES_PASSWORD=P4ssw0rd\"\n"
  },
  {
    "path": "contrib/postgres/schema.sql",
    "chars": 1015,
    "preview": "\\connect postgres://booktest:booktest@localhost/\n\nDROP TABLE IF EXISTS books CASCADE;\nDROP TYPE IF EXISTS book_type CASC"
  },
  {
    "path": "contrib/postgres/test.sql",
    "chars": 1977,
    "preview": "-- postgres test script\n\n\\set\n\n\\set SYNTAX_HL_FORMAT terminal16m\n\\set SYNTAX_HL true\n\n\\?\n\n\\copyright\n\n\\set SYNTAX_HL_STY"
  },
  {
    "path": "contrib/postgres/usql-config",
    "chars": 123,
    "preview": "DB=\"postgres://postgres:P4ssw0rd@localhost\"\nVSQL=\"SELECT setting AS version FROM pg_settings WHERE name='server_version'"
  },
  {
    "path": "contrib/presto/podman-config",
    "chars": 71,
    "preview": "NAME=presto\nIMAGE=docker.io/ahanaio/prestodb-sandbox\nPUBLISH=8080:8080\n"
  },
  {
    "path": "contrib/presto/usql-config",
    "chars": 97,
    "preview": "DB=\"presto://localhost\"\nVSQL=\"SELECT node_version AS version FROM system.runtime.nodes LIMIT 1;\"\n"
  },
  {
    "path": "contrib/sqlite3/build-windows-icu.sh",
    "chars": 165,
    "preview": "#!/bin/bash\n\n../source/runConfigureICU \\\n  MinGW \\\n  --host=x86_64-w64-mingw32 \\\n  --disable-release \\\n  --disable-debug"
  },
  {
    "path": "contrib/sqlite3/icu-i18n-mingw64.pc",
    "chars": 207,
    "preview": "mingw64_prefix=C:\\msys64\\opt\\local\n\nincludedir=\"${mingw64_prefix}\\include\"\nlibdir=\"${mingw64_prefix}\\lib\"\n\nName: icu-i18"
  },
  {
    "path": "contrib/sqlite3/test.sql",
    "chars": 1601,
    "preview": "-- sqlite3 test script\n\n\\set\n\n\\set SYNTAX_HL_FORMAT terminal16m\n\\set SYNTAX_HL true\n\nhelp\n\n\\?\n\n\\copyright\n\n\\set SYNTAX_H"
  },
  {
    "path": "contrib/sqlite3/usql-config",
    "chars": 69,
    "preview": "DB=\"sqlite3:test.sqlite3\"\nVSQL=\"SELECT sqlite_version() AS version;\"\n"
  },
  {
    "path": "contrib/sqlserver/init.sql",
    "chars": 1008,
    "preview": "EXEC sp_configure\n  'contained database authentication', 1;\n\nRECONFIGURE;\n\nDROP LOGIN :NAME;\n\nDROP DATABASE :NAME;\n\nCREA"
  },
  {
    "path": "contrib/sqlserver/podman-config",
    "chars": 146,
    "preview": "NAME=sqlserver\nIMAGE=mcr.microsoft.com/mssql/server:2022-latest\nPUBLISH=1433:1433\nENV=\"ACCEPT_EULA=Y MSSQL_PID=Express S"
  },
  {
    "path": "contrib/sqlserver/test.sql",
    "chars": 1545,
    "preview": "-- sqlserver test script\n\n\\set\n\n\\set SYNTAX_HL_FORMAT terminal16m\n\\set SYNTAX_HL true\n\n\\?\n\n\\copyright\n\n\\set SYNTAX_HL_ST"
  },
  {
    "path": "contrib/sqlserver/usql-config",
    "chars": 104,
    "preview": "DB=\"sqlserver://sa:Adm1nP@ssw0rd@localhost/\"\nVSQL=\"SELECT SERVERPROPERTY('productversion') AS version;\"\n"
  },
  {
    "path": "contrib/trino/podman-config",
    "chars": 59,
    "preview": "NAME=trino\nIMAGE=docker.io/trinodb/trino\nPUBLISH=8080:8080\n"
  },
  {
    "path": "contrib/trino/usql-config",
    "chars": 96,
    "preview": "DB=\"trino://localhost\"\nVSQL=\"SELECT node_version AS version FROM system.runtime.nodes LIMIT 1;\"\n"
  },
  {
    "path": "contrib/usql-test.sh",
    "chars": 621,
    "preview": "#!/bin/bash\n\nSRC=$(realpath $(cd -P \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd))\n\nUSQL=$(which usql)\nif [ -f $SRC/../usql ]"
  },
  {
    "path": "contrib/usqlpass",
    "chars": 492,
    "preview": "# sample ~/.usqlpass file\n# \n# format is:\n# protocol:host:port:dbname:user:pass\npostgres:*:*:*:postgres:P4ssw0rd\n\ncql:*:"
  },
  {
    "path": "contrib/usqlrc",
    "chars": 125,
    "preview": "-- example usqlrc file\n-- put in $HOME/.usqlrc\n\\echo welcome `echo $USER`, today is:`date`\n\\set SYNTAX_HL_STYLE paraiso-"
  },
  {
    "path": "contrib/vertica/podman-config",
    "chars": 124,
    "preview": "NAME=vertica\nIMAGE=docker.io/vertica/vertica-ce:latest\nPUBLISH=5433:5433\nENV=\"APP_DB_USER=vertica APP_DB_PASSWORD=P4ssw0"
  },
  {
    "path": "contrib/vertica/usql-config",
    "chars": 86,
    "preview": "DB=\"vertica://vertica:P4ssw0rd@localhost/vertica\"\nVSQL=\"SELECT version() AS version;\"\n"
  },
  {
    "path": "contrib/ydb/podman-config",
    "chars": 243,
    "preview": "NAME=ydb\nIMAGE=cr.yandex/yc/yandex-docker-local-ydb\nPUBLISH=\"2135:2135 2136:2136 8765:8765\"\nENV=\"YDB_DEFAULT_LOG_LEVEL=N"
  },
  {
    "path": "contrib/ydb/usql-config",
    "chars": 59,
    "preview": "DB=\"ydb://localhost/local\"\nVSQL=\"SELECT 'unk' as version;\"\n"
  },
  {
    "path": "drivers/adodb/adodb.go",
    "chars": 1074,
    "preview": "// Package adodb defines and registers usql's Microsoft ADODB driver. Requires\n// CGO. Windows only.\n//\n// Alias: oleodb"
  },
  {
    "path": "drivers/athena/athena.go",
    "chars": 682,
    "preview": "// Package athena defines and registers usql's AWS Athena driver.\n//\n// See: https://github.com/uber/athenadriver\npackag"
  },
  {
    "path": "drivers/avatica/avatica.go",
    "chars": 637,
    "preview": "// Package avatica defines and registers usql's Apache Avatica driver.\n//\n// See: https://github.com/apache/calcite-avat"
  },
  {
    "path": "drivers/bigquery/bigquery.go",
    "chars": 290,
    "preview": "// Package bigquery defines and registers usql's Google BigQuery driver.\n//\n// See: https://github.com/go-gorm/bigquery\n"
  },
  {
    "path": "drivers/cassandra/cassandra.go",
    "chars": 3383,
    "preview": "// Package cassandra defines and registers usql's Cassandra driver.\n//\n// See: https://github.com/MichaelS11/go-cql-driv"
  },
  {
    "path": "drivers/chai/chai.go",
    "chars": 259,
    "preview": "// Package chai defines and registers usql's ChaiSQL driver.\n//\n// See: https://github.com/chaisql/chai\npackage chai\n\nim"
  },
  {
    "path": "drivers/clickhouse/clickhouse.go",
    "chars": 1104,
    "preview": "// Package clickhouse defines and registers usql's ClickHouse driver.\n//\n// Group: base\n// See: https://github.com/Click"
  },
  {
    "path": "drivers/clickhouse/clickhouse_test.go",
    "chars": 33528,
    "preview": "package clickhouse_test\n\nimport (\n\t\"context\"\n\t\"database/sql\"\n\t\"flag\"\n\t\"fmt\"\n\t\"github.com/xo/dburl\"\n\t\"github.com/xo/usql/"
  },
  {
    "path": "drivers/clickhouse/reader.go",
    "chars": 5117,
    "preview": "package clickhouse\n\nimport (\n\t\"database/sql\"\n\t\"strings\"\n\n\t\"github.com/xo/usql/drivers\"\n\t\"github.com/xo/usql/drivers/meta"
  },
  {
    "path": "drivers/clickhouse/testdata/clickhouse.sql",
    "chars": 9356,
    "preview": "-- https://clickhouse.tech/docs/en/getting-started/tutorial/#create-tables\nCREATE DATABASE tutorial;\n\nCREATE TABLE tutor"
  },
  {
    "path": "drivers/completer/completer.go",
    "chars": 27888,
    "preview": "// completer package provides a generic SQL command line completer\npackage completer\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"path/filep"
  },
  {
    "path": "drivers/completer/completer_test.go",
    "chars": 5547,
    "preview": "package completer\n\nimport (\n\t\"testing\"\n\n\t\"github.com/xo/usql/drivers/metadata\"\n)\n\nfunc TestCompleter(t *testing.T) {\n\tca"
  },
  {
    "path": "drivers/cosmos/cosmos.go",
    "chars": 343,
    "preview": "// Package cosmos defines and registers usql's Azure CosmosDB driver.\n//\n// See: https://github.com/btnguyen2k/gocosmos\n"
  },
  {
    "path": "drivers/couchbase/couchbase.go",
    "chars": 1049,
    "preview": "// Package couchbase defines and registers usql's Couchbase driver.\n//\n// See: https://github.com/couchbase/go_n1ql\npack"
  },
  {
    "path": "drivers/csvq/csvq.go",
    "chars": 1013,
    "preview": "// Package csvq defines and registers usql's CSVQ driver.\n//\n// See: https://github.com/mithrandie/csvq-driver\n// Group:"
  },
  {
    "path": "drivers/databend/databend.go",
    "chars": 956,
    "preview": "// Package databend defines and registers usql's Databend driver.\n//\n// See: https://github.com/datafuselabs/databend-go"
  },
  {
    "path": "drivers/databricks/databricks.go",
    "chars": 555,
    "preview": "// Package databricks defines and registers usql's Databricks driver.\n//\n// See: https://github.com/databricks/databrick"
  },
  {
    "path": "drivers/drivers.go",
    "chars": 20177,
    "preview": "// Package drivers handles the registration, default implementation, and\n// handles hooks for usql database drivers.\npac"
  },
  {
    "path": "drivers/drivers_test.go",
    "chars": 16238,
    "preview": "// Package drivers_test runs integration tests for drivers package\n// on real databases running in containers. During de"
  },
  {
    "path": "drivers/duckdb/duckdb.go",
    "chars": 3865,
    "preview": "// Package duckdb defines and registers usql's DuckDB driver. Requires CGO.\n//\n// See: https://github.com/duckdb/duckdb-"
  },
  {
    "path": "drivers/dynamodb/dynamodb.go",
    "chars": 286,
    "preview": "// Package dynamodb defines and registers usql's DynamoDb driver.\n//\n// See: https://github.com/btnguyen2k/godynamo\npack"
  },
  {
    "path": "drivers/errors.go",
    "chars": 1205,
    "preview": "package drivers\n\nimport (\n\t\"strings\"\n\t\"unicode\"\n)\n\n// Error is a wrapper to standardize errors.\ntype Error struct {\n\tDri"
  },
  {
    "path": "drivers/exasol/exasol.go",
    "chars": 1022,
    "preview": "// Package exasol defines and registers usql's Exasol driver.\n//\n// See: https://github.com/exasol/exasol-driver-go\npack"
  },
  {
    "path": "drivers/firebird/firebird.go",
    "chars": 651,
    "preview": "// Package firebird defines and registers usql's Firebird driver.\n//\n// See: https://github.com/nakagami/firebirdsql\npac"
  },
  {
    "path": "drivers/flightsql/flightsql.go",
    "chars": 356,
    "preview": "// Package flightsql defines and registers usql's FlightSQL driver.\n//\n// See: https://github.com/apache/arrow/tree/main"
  },
  {
    "path": "drivers/godror/godror.go",
    "chars": 1236,
    "preview": "// Package godror defines and registers usql's GO DRiver for ORacle driver.\n// Requires CGO. Uses Oracle's ODPI-C (insta"
  },
  {
    "path": "drivers/h2/h2.go",
    "chars": 355,
    "preview": "// Package h2 defines and registers usql's Apache H2 driver.\n//\n// See: https://github.com/jmrobles/h2go\npackage h2\n\nimp"
  },
  {
    "path": "drivers/hive/hive.go",
    "chars": 460,
    "preview": "// Package hive defines and registers usql's Apache Hive driver.\n//\n// See: https://github.com/sql-machine-learning/gohi"
  },
  {
    "path": "drivers/ignite/ignite.go",
    "chars": 553,
    "preview": "// Package ignite defines and registers usql's Apache Ignite driver.\n//\n// See: https://github.com/amsokol/ignite-go-cli"
  },
  {
    "path": "drivers/impala/impala.go",
    "chars": 752,
    "preview": "// Package impala defines and registers usql's Apache Impala driver.\n//\n// See: https://github.com/sclgo/impala-go\npacka"
  },
  {
    "path": "drivers/maxcompute/maxcompute.go",
    "chars": 310,
    "preview": "// Package maxcompute defines and registers usql's Alibaba MaxCompute driver.\n//\n// See: https://github.com/sql-machine-"
  },
  {
    "path": "drivers/metadata/impala/metadata.go",
    "chars": 1913,
    "preview": "package impala\n\nimport (\n\t\"context\"\n\t\"database/sql\"\n\n\t\"github.com/xo/usql/drivers\"\n\t\"github.com/xo/usql/drivers/metadata"
  },
  {
    "path": "drivers/metadata/informationschema/metadata.go",
    "chars": 33233,
    "preview": "// Package informationschema provides metadata readers that query tables from\n// the information_schema schema. It tries"
  },
  {
    "path": "drivers/metadata/informationschema/metadata_test.go",
    "chars": 42323,
    "preview": "// Package informationschema_test runs integration tests for informationschema package\n// on real databases running in c"
  },
  {
    "path": "drivers/metadata/metadata.go",
    "chars": 21904,
    "preview": "package metadata\n\nimport (\n\t\"strings\"\n\n\t\"github.com/xo/dburl\"\n\t\"github.com/xo/usql/text\"\n)\n\n// ExtendedReader of all dat"
  },
  {
    "path": "drivers/metadata/metadata_test.go",
    "chars": 6499,
    "preview": "package metadata\n\nimport (\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestAccessPrivileges_String(t *testing.T)"
  },
  {
    "path": "drivers/metadata/mysql/metadata.go",
    "chars": 2351,
    "preview": "package mysql\n\nimport (\n\t\"time\"\n\n\t\"github.com/gohxs/readline\"\n\t\"github.com/xo/usql/drivers\"\n\t\"github.com/xo/usql/drivers"
  },
  {
    "path": "drivers/metadata/oracle/metadata.go",
    "chars": 12588,
    "preview": "// Package oracle provides a metadata reader\npackage oracle\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/xo"
  },
  {
    "path": "drivers/metadata/postgres/metadata.go",
    "chars": 13908,
    "preview": "// Package postgres provides a metadata reader\npackage postgres\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.co"
  },
  {
    "path": "drivers/metadata/postgres/metadata_test.go",
    "chars": 8941,
    "preview": "package postgres_test\n\nimport (\n\t\"database/sql\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\n\tdt \"github.com/ory/d"
  },
  {
    "path": "drivers/metadata/reader.go",
    "chars": 6430,
    "preview": "package metadata\n\nimport (\n\t\"context\"\n\t\"database/sql\"\n\t\"time\"\n\n\t\"github.com/xo/usql/text\"\n)\n\n// PluginReader allows to b"
  },
  {
    "path": "drivers/metadata/writer.go",
    "chars": 22593,
    "preview": "package metadata\n\nimport (\n\t\"context\"\n\t\"database/sql\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\n\t\"github.com/xo/dburl\"\n\t\"github.com/xo/tb"
  },
  {
    "path": "drivers/moderncsqlite/moderncsqlite.go",
    "chars": 1293,
    "preview": "// Package moderncsqlite defines and registers usql's ModernC SQLite3 driver.\n// Transpilation of SQLite3 to Go.\n//\n// S"
  },
  {
    "path": "drivers/mymysql/mymysql.go",
    "chars": 1218,
    "preview": "// Package mymysql defines and registers usql's MySQL MyMySQL driver.\n//\n// See: https://github.com/ziutek/mymysql\npacka"
  },
  {
    "path": "drivers/mysql/mysql.go",
    "chars": 1421,
    "preview": "// Package mysql defines and registers usql's MySQL driver.\n//\n// Alias: memsql, SingleStore MemSQL\n// Alias: vitess, Vi"
  },
  {
    "path": "drivers/netezza/netezza.go",
    "chars": 2161,
    "preview": "// Package netezza defines and registers usql's Netezza driver.\n//\n// See: https://github.com/IBM/nzgo\npackage netezza\n\n"
  },
  {
    "path": "drivers/odbc/odbc.go",
    "chars": 1257,
    "preview": "// Package odbc defines and registers usql's ODBC driver. Requires CGO. Uses\n// respective platform's standard ODBC pack"
  },
  {
    "path": "drivers/oracle/oracle.go",
    "chars": 1099,
    "preview": "// Package oracle defines and registers usql's Oracle Database driver.\n//\n// See: https://github.com/sijms/go-ora\n// Gro"
  },
  {
    "path": "drivers/oracle/orshared/orshared.go",
    "chars": 2373,
    "preview": "// Package orshared contains shared a shared driver implementation for the\n// Oracle Database. Used by Oracle and Godror"
  },
  {
    "path": "drivers/ots/ots.go",
    "chars": 319,
    "preview": "// Package ots defines and registers usql's Alibaba Tablestore driver.\n//\n// See: https://github.com/aliyun/aliyun-table"
  },
  {
    "path": "drivers/pgx/pgx.go",
    "chars": 4699,
    "preview": "// Package pgx defines and registers usql's PostgreSQL PGX driver.\n//\n// See: https://github.com/jackc/pgx\npackage pgx\n\n"
  },
  {
    "path": "drivers/postgres/postgres.go",
    "chars": 5827,
    "preview": "// Package postgres defines and registers usql's PostgreSQL driver.\n//\n// Alias: cockroachdb, CockroachDB\n// Alias: reds"
  },
  {
    "path": "drivers/presto/presto.go",
    "chars": 684,
    "preview": "// Package presto defines and registers usql's Presto driver.\n//\n// See: https://github.com/prestodb/presto-go-client\npa"
  },
  {
    "path": "drivers/ql/ql.go",
    "chars": 461,
    "preview": "// Package ql defines and registers usql's Cznic QL driver.\n//\n// See: https://gitlab.com/cznic/ql\npackage ql\n\nimport (\n"
  },
  {
    "path": "drivers/qtype.go",
    "chars": 17415,
    "preview": "package drivers\n\nimport (\n\t\"strings\"\n)\n\n// queryMap is the map of SQL prefixes use as queries.\nvar queryMap = map[string"
  },
  {
    "path": "drivers/ramsql/ramsql.go",
    "chars": 273,
    "preview": "// Package ramsql defines and registers usql's RamSQL driver.\n//\n// See: https://github.com/proullon/ramsql\npackage ql\n\n"
  },
  {
    "path": "drivers/sapase/sapase.go",
    "chars": 1284,
    "preview": "// Package sapase defines and registers usql's SAP ASE driver.\n//\n// See: https://github.com/thda/tds\npackage sapase\n\nim"
  },
  {
    "path": "drivers/saphana/saphana.go",
    "chars": 859,
    "preview": "// Package saphana defines and registers usql's SAP HANA driver.\n//\n// See: https://github.com/SAP/go-hdb\npackage saphan"
  },
  {
    "path": "drivers/snowflake/snowflake.go",
    "chars": 1714,
    "preview": "// Package snowflake defines and registers usql's Snowflake driver.\n//\n// See: https://github.com/snowflakedb/gosnowflak"
  },
  {
    "path": "drivers/spanner/spanner.go",
    "chars": 301,
    "preview": "// Package spanner defines and registers usql's Google Spanner driver.\n//\n// See: https://github.com/googleapis/go-sql-s"
  },
  {
    "path": "drivers/sqlite3/sqlite3.go",
    "chars": 1167,
    "preview": "// Package sqlite3 defines and registers usql's SQLite3 driver. Requires CGO.\n//\n// See: https://github.com/mattn/go-sql"
  },
  {
    "path": "drivers/sqlite3/sqshared/reader.go",
    "chars": 7972,
    "preview": "package sqshared\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/xo/usql/drivers\"\n\t\"github.com/xo/usql/drivers"
  },
  {
    "path": "drivers/sqlite3/sqshared/reader_test.go",
    "chars": 8492,
    "preview": "package sqshared\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"database/sql\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"os/user\"\n\t\"path\"\n\t\"strings\"\n\t\"testi"
  },
  {
    "path": "drivers/sqlite3/sqshared/sqshared.go",
    "chars": 2230,
    "preview": "// Package sqshared contains shared types for the sqlite3 and moderncsqlite\n// drivers.\npackage sqshared\n\nimport (\n\t\"dat"
  },
  {
    "path": "drivers/sqlserver/reader.go",
    "chars": 6557,
    "preview": "package sqlserver\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/xo/usql/drivers\"\n\t\"github.com/xo/usql/driver"
  },
  {
    "path": "drivers/sqlserver/sqlserver.go",
    "chars": 3588,
    "preview": "// Package sqlserver defines and registers usql's Microsoft SQL Server driver.\n//\n// See: https://github.com/microsoft/g"
  },
  {
    "path": "drivers/sqlserver/sqlserver_test.go",
    "chars": 7316,
    "preview": "package sqlserver_test\n\nimport (\n\t\"database/sql\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/url\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\n\tdt \"gith"
  },
  {
    "path": "drivers/testdata/.gitignore",
    "chars": 13,
    "preview": "*.actual.txt\n"
  },
  {
    "path": "drivers/testdata/csvq/.gitignore",
    "chars": 7,
    "preview": "*_copy\n"
  },
  {
    "path": "drivers/testdata/docker/Dockerfile",
    "chars": 230,
    "preview": "ARG BASE_IMAGE\nFROM $BASE_IMAGE\n\nARG SCHEMA_URL\nARG TARGET\nARG USER\nADD --chown=$USER $SCHEMA_URL $TARGET/\nRUN [ ! -d \"$"
  },
  {
    "path": "drivers/testdata/gen-golden.sh",
    "chars": 2016,
    "preview": "#!/usr/bin/env bash\n\npgsql_in_docker=false\npgsql_container=usql-pgsql\n\nif [ \"$pgsql_in_docker\" != true ]; then\n    PGHOS"
  },
  {
    "path": "drivers/testdata/mysql.descTable.expected.txt",
    "chars": 7964,
    "preview": "                                                                         BASE TABLE \"sakila.film\"\n         Name         "
  },
  {
    "path": "drivers/testdata/mysql.descTable.golden.txt",
    "chars": 11990,
    "preview": "mysql: [Warning] Using a password on the command line interface can be insecure.\r\n+----------------------+--------------"
  },
  {
    "path": "drivers/testdata/mysql.listFuncs.expected.txt",
    "chars": 1400,
    "preview": "                                                                        List of functions\n Schema |            Name     "
  },
  {
    "path": "drivers/testdata/mysql.listIndexes.expected.txt",
    "chars": 3697,
    "preview": "                                   List of indexes\n Schema |            Name             |   Type   |     Table     | Pr"
  },
  {
    "path": "drivers/testdata/mysql.listSchemas.expected.txt",
    "chars": 78,
    "preview": " List of schemas\n Schema | Catalog \n--------+---------\n sakila | def \n(1 row)\n"
  },
  {
    "path": "drivers/testdata/mysql.listSchemas.golden.txt",
    "chars": 298,
    "preview": "mysql: [Warning] Using a password on the command line interface can be insecure.\r\n+--------------------+\r\n| Database    "
  },
  {
    "path": "drivers/testdata/mysql.listTables.expected.txt",
    "chars": 448,
    "preview": "                      List of relations\n Schema |     Name      |    Type    | Rows | Size | Comment \n--------+---------"
  },
  {
    "path": "drivers/testdata/mysql.listTables.golden.txt",
    "chars": 352,
    "preview": "mysql: [Warning] Using a password on the command line interface can be insecure.\r\n+--------------------------+\r\n| Tables"
  },
  {
    "path": "drivers/testdata/pgsql.descTable.expected.txt",
    "chars": 8083,
    "preview": "                                                                   table \"public.film\"\n         Name         |          "
  },
  {
    "path": "drivers/testdata/pgsql.descTable.golden.txt",
    "chars": 6362,
    "preview": "                                                Table \"public.film\"\n        Column        |            Type             "
  },
  {
    "path": "drivers/testdata/pgsql.listDbs.golden.txt",
    "chars": 625,
    "preview": "                                 List of databases\n   Name    |  Owner   | Encoding |  Collate   |   Ctype    |   Access"
  },
  {
    "path": "drivers/testdata/pgsql.listFuncs.expected.txt",
    "chars": 1736,
    "preview": "                                                            List of functions\n Schema |            Name            | Res"
  },
  {
    "path": "drivers/testdata/pgsql.listFuncs.golden.txt",
    "chars": 1684,
    "preview": "                                                          List of functions\n Schema |            Name            | Resul"
  },
  {
    "path": "drivers/testdata/pgsql.listIndexes.expected.txt",
    "chars": 5062,
    "preview": "                                               List of indexes\n Schema |                        Name                    "
  },
  {
    "path": "drivers/testdata/pgsql.listIndexes.golden.txt",
    "chars": 4372,
    "preview": "                                         List of relations\n Schema |                        Name                        "
  },
  {
    "path": "drivers/testdata/pgsql.listSchemas.expected.txt",
    "chars": 86,
    "preview": "  List of schemas\n Schema | Catalog  \n--------+----------\n public | postgres \n(1 row)\n"
  },
  {
    "path": "drivers/testdata/pgsql.listSchemas.golden.txt",
    "chars": 86,
    "preview": "  List of schemas\n  Name  |  Owner   \n--------+----------\n public | postgres\n(1 row)\n\n"
  },
  {
    "path": "drivers/testdata/pgsql.listTables.expected.txt",
    "chars": 500,
    "preview": "                         List of relations\n Schema |       Name       |   Type   | Rows |    Size    | Comment \n--------"
  },
  {
    "path": "drivers/testdata/pgsql.listTables.golden.txt",
    "chars": 389,
    "preview": "                List of relations\n Schema |       Name       |   Type   |  Owner   \n--------+------------------+--------"
  },
  {
    "path": "drivers/testdata/sqlserver.descTable.expected.txt",
    "chars": 5466,
    "preview": "                                               BASE TABLE \"dbo.film\"\n         Name         |     Type     | Nullable |  "
  },
  {
    "path": "drivers/testdata/sqlserver.listFuncs.expected.txt",
    "chars": 9,
    "preview": "(0 rows)\n"
  },
  {
    "path": "drivers/testdata/sqlserver.listIndexes.expected.txt",
    "chars": 5456,
    "preview": "                                       List of indexes\n Schema |              Name              |     Type     |     Tab"
  },
  {
    "path": "drivers/testdata/sqlserver.listSchemas.expected.txt",
    "chars": 100,
    "preview": " List of schemas\n Schema | Catalog \n--------+---------\n dbo    | sakila \n guest  | sakila \n(2 rows)\n"
  },
  {
    "path": "drivers/testdata/sqlserver.listTables.expected.txt",
    "chars": 448,
    "preview": "                      List of relations\n Schema |     Name      |    Type    | Rows | Size | Comment \n--------+---------"
  },
  {
    "path": "drivers/testdata/trino.descTable.expected.txt",
    "chars": 10270,
    "preview": "                                     BASE TABLE \"sf1.orders\"\n     Name      |    Type     | Nullable | Default | Size | "
  },
  {
    "path": "drivers/testdata/trino.listSchemas.expected.txt",
    "chars": 231,
    "preview": "  List of schemas\n  Schema  | Catalog \n----------+---------\n sf1      | tpch \n sf100    | tpch \n sf1000   | tpch \n sf100"
  },
  {
    "path": "drivers/testdata/trino.listTables.expected.txt",
    "chars": 610,
    "preview": "                   List of relations\n  Schema  |  Name  |    Type    | Rows | Size | Comment \n----------+--------+------"
  },
  {
    "path": "drivers/trino/reader.go",
    "chars": 2126,
    "preview": "package trino\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/xo/usql/drivers/metadata\"\n)\n\ntype metaReader str"
  },
  {
    "path": "drivers/trino/trino.go",
    "chars": 1782,
    "preview": "// Package trino defines and registers usql's Trino driver.\n//\n// See: https://github.com/trinodb/trino-go-client\npackag"
  },
  {
    "path": "drivers/vertica/vertica.go",
    "chars": 2644,
    "preview": "// Package vertica defines and registers usql's Vertica driver.\n//\n// See: https://github.com/vertica/vertica-sql-go\npac"
  },
  {
    "path": "drivers/voltdb/voltdb.go",
    "chars": 333,
    "preview": "// Package voltdb defines and registers usql's VoltDB driver.\n//\n// See: https://github.com/VoltDB/voltdb-client-go\npack"
  },
  {
    "path": "drivers/ydb/ydb.go",
    "chars": 724,
    "preview": "// Package ydb defines and registers usql's YDB driver.\n//\n// See: https://github.com/ydb-platform/ydb-go-sdk\npackage yd"
  },
  {
    "path": "env/env.go",
    "chars": 9805,
    "preview": "// Package env contains runtime environment variables for usql, along with\n// various helper funcs to determine the user"
  },
  {
    "path": "env/list.go",
    "chars": 6551,
    "preview": "package env\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/xo/us"
  },
  {
    "path": "env/vars.go",
    "chars": 10608,
    "preview": "package env\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"maps\"\n\t\"os/exec\"\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\tsyslocale \"github.com/je"
  },
  {
    "path": "gen.go",
    "chars": 21020,
    "preview": "//go:build ignore\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"go/ast\"\n\t\"go/format\"\n\t\"go/parser\""
  },
  {
    "path": "go.mod",
    "chars": 19611,
    "preview": "module github.com/xo/usql\n\ngo 1.26\n\nrequire (\n\tgithub.com/ClickHouse/clickhouse-go/v2 v2.43.0\n\tgithub.com/IBM/nzgo/v12 v"
  },
  {
    "path": "go.sum",
    "chars": 181206,
    "preview": "cel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4=\ncel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ"
  },
  {
    "path": "handler/handler.go",
    "chars": 44910,
    "preview": "// Package handler provides a input process handler implementation for usql.\npackage handler\n\nimport (\n\t\"bufio\"\n\t\"bytes\""
  },
  {
    "path": "internal/adodb.go",
    "chars": 184,
    "preview": "//go:build (all || most || adodb) && !no_adodb\n\npackage internal\n\n// Code generated by gen.go. DO NOT EDIT.\n\nimport (\n\t_"
  },
  {
    "path": "internal/athena.go",
    "chars": 182,
    "preview": "//go:build (all || most || athena) && !no_athena\n\npackage internal\n\n// Code generated by gen.go. DO NOT EDIT.\n\nimport (\n"
  },
  {
    "path": "internal/avatica.go",
    "chars": 189,
    "preview": "//go:build (all || most || avatica) && !no_avatica\n\npackage internal\n\n// Code generated by gen.go. DO NOT EDIT.\n\nimport "
  },
  {
    "path": "internal/bigquery.go",
    "chars": 193,
    "preview": "//go:build (all || most || bigquery) && !no_bigquery\n\npackage internal\n\n// Code generated by gen.go. DO NOT EDIT.\n\nimpor"
  },
  {
    "path": "internal/cassandra.go",
    "chars": 190,
    "preview": "//go:build (all || most || cassandra) && !no_cassandra\n\npackage internal\n\n// Code generated by gen.go. DO NOT EDIT.\n\nimp"
  },
  {
    "path": "internal/chai.go",
    "chars": 173,
    "preview": "//go:build (all || most || chai) && !no_chai\n\npackage internal\n\n// Code generated by gen.go. DO NOT EDIT.\n\nimport (\n\t_ \""
  }
]

// ... and 68 more files (download for full content)

About this extraction

This page contains the full source code of the xo/usql GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 268 files (1.1 MB), approximately 402.3k tokens, and a symbol index with 901 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!