Full Code of scylladb/gocql for AI

master ebb024992fe2 cached
375 files
2.8 MB
753.7k tokens
4195 symbols
1 requests
Download .txt
Showing preview only (3,013K chars total). Download the full file or copy to clipboard to get everything.
Repository: scylladb/gocql
Branch: master
Commit: ebb024992fe2
Files: 375
Total size: 2.8 MB

Directory structure:
gitextract_l7q0abss/

├── .git-blame-ignore-revs
├── .github/
│   ├── dependabot.yml
│   ├── issue_template.md
│   └── workflows/
│       ├── bench-tests.yml
│       ├── call_jira_sync.yml
│       ├── clean_dockerhub_images.yml
│       ├── docs-pages.yml
│       ├── docs-pr.yml
│       ├── extended-ci-longevity-large-partitions-with-network-nemesis-1h-test.yml
│       └── main.yml
├── .gitignore
├── .golangci.yml
├── CONTRIBUTING.md
├── LICENSE
├── Makefile
├── NOTICE
├── README.md
├── address_translators.go
├── address_translators_test.go
├── batch_test.go
├── callreq_wait.go
├── callreq_wait_race.go
├── cass1batch_test.go
├── cassandra_test.go
├── ci/
│   └── clean-old-temporary-docker-images.py
├── client_routes.go
├── client_routes_test.go
├── client_routes_unit_test.go
├── cloud_cluster_test.go
├── cluster.go
├── cluster_test.go
├── common_test.go
├── compressor.go
├── compressor_test.go
├── conn.go
├── conn_test.go
├── connectionpool.go
├── connectionpool_test.go
├── connpicker.go
├── control.go
├── control_integration_test.go
├── control_test.go
├── cqltypes.go
├── debounce/
│   ├── refresh_deboucer.go
│   ├── refresh_debouncer_test.go
│   ├── simple_debouncer.go
│   └── simple_debouncer_test.go
├── dial.go
├── dialer/
│   ├── recorder/
│   │   └── recorder.go
│   ├── replayer/
│   │   └── replayer.go
│   └── utils.go
├── dns_test.go
├── doc.go
├── docs/
│   ├── Makefile
│   ├── _utils/
│   │   └── redirects.yaml
│   ├── pyproject.toml
│   └── source/
│       ├── conf.py
│       ├── index.rst
│       └── sample-page.rst
├── errors.go
├── errors_test.go
├── events/
│   ├── event_converter.go
│   ├── event_converter_test.go
│   ├── events.go
│   └── events_test.go
├── events.go
├── events_test.go
├── events_unit_test.go
├── example_batch_test.go
├── example_dynamic_columns_test.go
├── example_lwt_batch_test.go
├── example_lwt_test.go
├── example_marshaler_test.go
├── example_nulls_test.go
├── example_paging_test.go
├── example_set_test.go
├── example_test.go
├── example_udt_map_test.go
├── example_udt_marshaler_test.go
├── example_udt_struct_test.go
├── example_udt_unmarshaler_test.go
├── exec.go
├── exec_test.go
├── export_test.go
├── filters.go
├── filters_test.go
├── frame.go
├── frame_test.go
├── framer.go
├── framer_bench_test.go
├── go.mod
├── go.sum
├── helpers.go
├── helpers_bench_test.go
├── host_source.go
├── host_source_scylla.go
├── host_source_test.go
├── hostpolicy/
│   ├── hostpool.go
│   └── hostpool_test.go
├── install_test_deps.sh
├── integration.sh
├── integration_only.go
├── integration_serialization_scylla_test.go
├── integration_test.go
├── internal/
│   ├── ccm/
│   │   ├── ccm.go
│   │   └── ccm_test.go
│   ├── debug/
│   │   ├── debug_off.go
│   │   └── debug_on.go
│   ├── eventbus/
│   │   ├── README.md
│   │   ├── eventbus.go
│   │   ├── eventbus_test.go
│   │   └── example_test.go
│   ├── frame/
│   │   └── frames.go
│   ├── lru/
│   │   ├── lru.go
│   │   └── lru_test.go
│   ├── murmur/
│   │   ├── murmur.go
│   │   ├── murmur_appengine.go
│   │   ├── murmur_test.go
│   │   └── murmur_unsafe.go
│   ├── streams/
│   │   ├── streams.go
│   │   └── streams_test.go
│   └── tests/
│       ├── common.go
│       ├── err_equal.go
│       ├── mock/
│       │   └── mock_framer.go
│       ├── rand.go
│       └── serialization/
│           ├── mod/
│           │   ├── all.go
│           │   ├── custom.go
│           │   ├── custom_refs.go
│           │   └── refs.go
│           ├── pointers.go
│           ├── pointers_test.go
│           ├── set_negative_marshal.go
│           ├── set_negative_unmarshal.go
│           ├── set_positive.go
│           ├── utils.go
│           ├── utils_equal.go
│           ├── utils_error.go
│           ├── utils_new.go
│           ├── utils_str.go
│           └── valcases/
│               ├── get.go
│               └── simple.go
├── keyspace_table_test.go
├── logger.go
├── lz4/
│   ├── go.mod
│   ├── go.sum
│   ├── lz4.go
│   ├── lz4_bench_test.go
│   └── lz4_test.go
├── marshal.go
├── marshal_test.go
├── metadata_scylla.go
├── metadata_scylla_test.go
├── policies.go
├── policies_bench_test.go
├── policies_integration_test.go
├── policies_test.go
├── prepared_cache.go
├── query_error_test.go
├── query_executor.go
├── recreate.go
├── recreate_test.go
├── renovate.json
├── ring_describer.go
├── ring_describer_test.go
├── schema_queries_test.go
├── scylla.go
├── scylla_cdc.go
├── scylla_shard_aware_port_common_test.go
├── scylla_shard_aware_port_integration_test.go
├── scylla_shard_aware_port_mocked_test.go
├── scylla_test.go
├── scylla_tokens_test.go
├── scyllacloud/
│   ├── cluster.go
│   ├── config.go
│   ├── config_test.go
│   ├── hostdialer.go
│   └── hostdialer_test.go
├── serialization/
│   ├── ascii/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── bigint/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── blob/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   ├── unmarshal_utils.go
│   │   └── unmarshal_utils_test.go
│   ├── boolean/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── counter/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── cqlint/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── cqltime/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── date/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── decimal/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   ├── unmarshal_ints.go
│   │   └── unmarshal_utils.go
│   ├── double/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── duration/
│   │   ├── duration.go
│   │   ├── marshal.go
│   │   ├── marshal_str.go
│   │   ├── marshal_str_test.go
│   │   ├── marshal_utils.go
│   │   ├── marshal_vint_test.go
│   │   ├── unmarshal.go
│   │   ├── unmarshal_str.go
│   │   ├── unmarshal_str_test.go
│   │   ├── unmarshal_utils.go
│   │   └── unmarshal_vint_test.go
│   ├── float/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── inet/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── smallint/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── text/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── timestamp/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── timeuuid/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── tinyint/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── uuid/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── varchar/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   └── varint/
│       ├── marshal.go
│       ├── marshal_bigint_test.go
│       ├── marshal_custom.go
│       ├── marshal_ints.go
│       ├── marshal_uints.go
│       ├── marshal_utils.go
│       ├── unmarshal.go
│       ├── unmarshal_bigint_test.go
│       ├── unmarshal_custom.go
│       ├── unmarshal_ints.go
│       ├── unmarshal_uints.go
│       └── unmarshal_utils.go
├── session.go
├── session_connect_test.go
├── session_event_bus_integration_test.go
├── session_event_bus_test.go
├── session_test.go
├── session_unit_test.go
├── stress_test.go
├── tablet_integration_test.go
├── tablets/
│   ├── cow_tablet_list_test.go
│   ├── tabets_utils_test.go
│   ├── tablet_utils.go
│   ├── tablets.go
│   ├── tablets_bench_test.go
│   └── tablets_test.go
├── testdata/
│   ├── pki/
│   │   ├── ca.cnf
│   │   ├── cassandra.cnf
│   │   ├── generate_certs.sh
│   │   └── gocql.cnf
│   └── recreate/
│       ├── aggregates.cql
│       ├── aggregates_golden.cql
│       ├── index.cql
│       ├── index_golden.cql
│       ├── keyspace.cql
│       ├── keyspace_golden.cql
│       ├── materialized_views.cql
│       ├── materialized_views_golden.cql
│       ├── scylla_encryption_options_golden.json
│       ├── secondary_index.cql
│       ├── secondary_index_golden.cql
│       ├── table.cql
│       ├── table_golden.cql
│       ├── udt.cql
│       └── udt_golden.cql
├── tests/
│   ├── bench/
│   │   ├── bench_marshal_test.go
│   │   ├── bench_single_conn_test.go
│   │   ├── bench_vector_public_test.go
│   │   ├── go.mod
│   │   ├── go.sum
│   │   ├── rec_insert/
│   │   │   ├── 192.168.100.11:9042-0Reads
│   │   │   └── 192.168.100.11:9042-0Writes
│   │   └── rec_select/
│   │       ├── 192.168.100.11:9042-0Reads
│   │       └── 192.168.100.11:9042-0Writes
│   └── serialization/
│       ├── marshal_0_unset_test.go
│       ├── marshal_10_decimal_corrupt_test.go
│       ├── marshal_10_decimal_test.go
│       ├── marshal_11_texts_test.go
│       ├── marshal_12_ascii_corrupt_test.go
│       ├── marshal_12_ascii_test.go
│       ├── marshal_13_uuids_corrupt_test.go
│       ├── marshal_13_uuids_test.go
│       ├── marshal_14_inet_corrupt_test.go
│       ├── marshal_14_inet_test.go
│       ├── marshal_15_time_corrupt_test.go
│       ├── marshal_15_time_test.go
│       ├── marshal_16_timestamp_corrupt_test.go
│       ├── marshal_16_timestamp_test.go
│       ├── marshal_17_date_corrupt_test.go
│       ├── marshal_17_date_test.go
│       ├── marshal_18_duration_corrupt_test.go
│       ├── marshal_18_duration_test.go
│       ├── marshal_19_list_set_v3_corrupt_test.go
│       ├── marshal_19_list_set_v3_test.go
│       ├── marshal_1_boolean_corrupt_test.go
│       ├── marshal_1_boolean_test.go
│       ├── marshal_20_map_v3_corrupt_test.go
│       ├── marshal_20_map_v3_test.go
│       ├── marshal_2_tinyint_corrupt_test.go
│       ├── marshal_2_tinyint_test.go
│       ├── marshal_3_smallint_corrupt_test.go
│       ├── marshal_3_smallint_test.go
│       ├── marshal_4_int_corrupt_test.go
│       ├── marshal_4_int_test.go
│       ├── marshal_5_bigint_corrupt_test.go
│       ├── marshal_5_bigint_test.go
│       ├── marshal_6_counter_corrupt_test.go
│       ├── marshal_6_counter_test.go
│       ├── marshal_7_varint_corrupt_test.go
│       ├── marshal_7_varint_test.go
│       ├── marshal_8_float_corrupt_test.go
│       ├── marshal_8_float_test.go
│       ├── marshal_9_double_corrupt_test.go
│       └── marshal_9_duble_test.go
├── token.go
├── token_test.go
├── topology.go
├── topology_test.go
├── tracer.go
├── tracer_test.go
├── tuple_test.go
├── udt_test.go
├── uuid.go
├── uuid_test.go
├── vector_bench_test.go
├── vector_test.go
├── version.go
├── warning_handler.go
└── wiki_test.go

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

================================================
FILE: .git-blame-ignore-revs
================================================
# Commit that replaced interface{} with any across the codebase.
# Purely mechanical rename with no behavioral change.
3ab64422067e24efb0b6b30eea0396d0e9395aee


================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: "uv"
    directory: "/docs"
    schedule:
      interval: "daily"
    allow:
      - dependency-name: "sphinx-scylladb-theme"
      - dependency-name: "sphinx-multiversion-scylla"

================================================
FILE: .github/issue_template.md
================================================
Please answer these questions before submitting your issue. Thanks!

### What version of ScyllaDB or Cassandra are you using?


### What version of ScyllaDB Gocql driver are you using?


### What version of Go are you using?


### What did you do?


### What did you expect to see?


### What did you see instead?

---

If you are having connectivity related issues please share the following additional information

### Describe your Cassandra cluster
please provide the following information

- output of `nodetool status`
- output of `SELECT peer, rpc_address FROM system.peers`
- rebuild your application with the `gocql_debug` tag and post the output


================================================
FILE: .github/workflows/bench-tests.yml
================================================
name: Run benchmark tests

on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  bench-tests:
    if: contains(github.event.pull_request.labels.*.name, 'run-benchmark-tests')
    name: Run benchmark tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
      - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
        with:
          go-version-file: go.mod
          cache-dependency-path: |
            lz4/go.sum
            tests/bench/go.sum
            go.sum


      - name: Run benchmark tests
        run: make test-bench


================================================
FILE: .github/workflows/call_jira_sync.yml
================================================
name: Sync Jira Based on PR Events

on:
  pull_request_target:
    types: [opened, edited, ready_for_review, review_requested, labeled, unlabeled, closed]

permissions:
  contents: read
  pull-requests: write
  issues: write

jobs:
  jira-sync:
    uses: scylladb/github-automation/.github/workflows/main_pr_events_jira_sync.yml@main
    with:
      caller_action: ${{ github.event.action }}
    secrets:
      caller_jira_auth: ${{ secrets.USER_AND_KEY_FOR_JIRA_AUTOMATION }}


================================================
FILE: .github/workflows/clean_dockerhub_images.yml
================================================
name: Docker Cleanup

on:
  schedule:
    - cron: '0 12 * * 1'  # Runs every Monday at noon (UTC)
  workflow_dispatch:

jobs:
  cleanup:
    runs-on: ubuntu-latest
    steps:
      - name: Check out the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

      - name: Set up Python
        uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
        with:
          python-version: "3.x"

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install requests

      - name: Run Docker image cleanup
        run: make clean-old-temporary-docker-images
        env:
          DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
          DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
          DELETE_AFTER_DAYS: 30


================================================
FILE: .github/workflows/docs-pages.yml
================================================
name: "Docs / Publish"
# For more information,
# see https://sphinx-theme.scylladb.com/stable/deployment/production.html#available-workflows

on:
  push:
    branches:
      - master
      - 'branch-**'
    paths:
      - "docs/**"
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
        with:
          ref: ${{ github.event.repository.default_branch }}
          persist-credentials: false
          fetch-depth: 0

      - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
        # actions/setup-python@v6 poetry cache feature requires poetry to be installed beforehand
        # which makes use of it extremely awkward.
        with:
          path: |
            /home/runner/.cache/pip
            /home/runner/.cache/uv
          key: docs-cache-${{ runner.os }}-${{ hashFiles('docs/pyproject.toml', 'docs/Makefile') }}

      - name: Set up Python
        uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
        with:
          python-version: '3.12'

      - name: Install uv
        uses: astral-sh/setup-uv@v6

      - name: Set up env
        run: make -C docs setupenv

      - name: Build docs
        run: make -C docs multiversion

      - name: Build redirects
        run: make -C docs redirects

      - name: Tar folder
        run: |
          tar \
            --dereference --hard-dereference \
            --directory docs/_build/dirhtml/ \
            -cvf ${{ runner.temp }}/artifact.tar \
            .

      - name: Upload artifact
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
        with:
          name: github-pages
          path: ${{ runner.temp }}/artifact.tar
          retention-days: "1"

  release:
    # Add a dependency to the build job
    needs: build

    # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
    permissions:
      pages: write # to deploy to Pages
      id-token: write # to verify the deployment originates from an appropriate source
      contents: read # to read private repo

    # Deploy to the github-pages environment
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}

    # Specify runner + deployment step
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5


================================================
FILE: .github/workflows/docs-pr.yml
================================================
name: "Docs / Build PR"
# For more information,
# see https://sphinx-theme.scylladb.com/stable/deployment/production.html#available-workflows

on:
  push:
    paths:
      - "docs/**"
      - ".github/workflows/docs-pr.yml"
  pull_request:
    types: [opened, synchronize, reopened]
    paths:
      - "docs/**"
      - ".github/workflows/docs-pr.yml"
  workflow_dispatch:

permissions:
  contents: read

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
        with:
          persist-credentials: false
          fetch-depth: 0

      - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
        # actions/setup-python@v6 poetry cache feature requires poetry to be installed beforehand
        # which makes use of it extremely awkward.
        with:
          path: |
            /home/runner/.cache/pip
            /home/runner/.cache/uv
          key: docs-cache-${{ runner.os }}-${{ hashFiles('docs/pyproject.toml', 'docs/Makefile') }}

      - name: Set up Python
        uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
        with:
          python-version: '3.12'

      - name: Install uv
        uses: astral-sh/setup-uv@v6

      - name: Set up env
        run: make -C docs setupenv

      - name: Build docs
        run: make -C docs test


================================================
FILE: .github/workflows/extended-ci-longevity-large-partitions-with-network-nemesis-1h-test.yml
================================================
name: Build scylla-bench docker image with gocql PR

on:
  pull_request_target:
    types: [labeled]

jobs:
  trigger-longevity-large-partitions-with-network-nemesis-1h-test:
    if: contains(github.event.pull_request.labels.*.name, 'extended-ci')
    runs-on: ubuntu-latest
    strategy:
      matrix:
        scylla-version: [ENTERPRISE-RELEASE, OSS-RELEASE]
    steps:
      - name: Login to Docker Hub
        uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Check out the scylla-bench repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
        with:
          repository: scylladb/scylla-bench
          path: scylla-bench

      - name: Checkout GoCQL PR Repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
        with:
          repository: ${{ github.event.pull_request.head.repo.full_name }}
          ref: ${{ github.event.pull_request.head.sha }}
          path: gocql

      - name: Build and push Scylla-bench Docker Image with gocql from PR
        run: |
          cd scylla-bench
          GOCQL_REPO="github.com/${{ github.event.pull_request.head.repo.full_name }}" GOCQL_VERSION="${{ github.event.pull_request.head.sha }}" make build-with-custom-gocql-version
          DOCKER_IMAGE_TAG="scylladb/gocql-extended-ci:scylla-bench-${{ github.event.pull_request.head.sha }}" DOCKER_IMAGE_LABELS="com.scylladb.gocql-version=${{ github.event.pull_request.head.sha }}" make build-sct-docker-image
          docker push "scylladb/gocql-extended-ci:scylla-bench-${{ github.event.pull_request.head.sha }}"

      - name: Install get-version CLI
        run: |
          git clone https://github.com/scylladb-actions/get-version.git
          cd get-version
          go mod tidy
          go build -o get-version

      - name: Get scylla version
        id: scylla-version
        run: |
          cd get-version
          if [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RELEASE" ]]; then
            echo "value=$(./get-version --source dockerhub-imagetag --repo scylladb/scylla-enterprise -filters "^[0-9]{4}$.^[0-9]+$.^[0-9]+$ and LAST.LAST.LAST" | tr -d '\"')" >> $GITHUB_ENV
          elif [[ "${{ matrix.scylla-version }}" == "OSS-RELEASE" ]]; then
            echo "value=$(./get-version --source dockerhub-imagetag --repo scylladb/scylla -filters "^[0-9]$.^[0-9]+$.^[0-9]+$ and LAST.LAST.LAST" | tr -d '\"')" >> $GITHUB_ENV
          elif echo "${{ matrix.scylla-version }}" | grep -P '^[0-9\.]+'; then # If you want to run specific version do just that
            echo "value=${{ matrix.scylla-version }}" | tee -a $GITHUB_OUTPUT
          else
            echo "Unknown scylla version name `${{ matrix.scylla-version }}`"
            exit 1
          fi

      - name: Start Jenkins job
        uses: scylladb-actions/jenkins-client@b947e07e8b588db2a8028313274992d3eda73360 # v0.2.0
        with:
          job_name: scylla-drivers/job/gocql/job/extended-ci/job/longevity-large-partitions-with-network-nemesis-1h-test
          job_parameters: '{"email_recipients": "scylla-drivers@scylladb.com", "scylla_version": "${{ steps.scylla-version.outputs.value }}", "extra_environment_variables": "SCT_STRESS_IMAGE.scylla-bench=scylladb/gocql-extended-ci:scylla-bench-${{ github.event.pull_request.head.sha }}"}'
          base_url: https://jenkins.scylladb.com
          user: ${{ secrets.JENKINS_USERNAME }}
          password: ${{ secrets.JENKINS_TOKEN }}
          wait_timeout: 3h
          polling_interval: 1s


================================================
FILE: .github/workflows/main.yml
================================================
name: Build

on:
  push:
    branches:
      - master
    paths-ignore:
      - "*.md"
      - "docs/**"
      - .github/workflows/docs-*
      - .github/workflows/bench-tests.yml
      - .github/workflows/extended-ci-longevity-large-partitions-with-network-nemesis-1h-test.yml
  pull_request:
    types: [opened, synchronize, reopened]
    paths-ignore:
      - "*.md"
      - "docs/**"
      - .github/workflows/docs-*
      - .github/workflows/bench-tests.yml
      - .github/workflows/extended-ci-longevity-large-partitions-with-network-nemesis-1h-test.yml

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

      - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
        with:
          path: |
            /home/runner/.cache/pip
            /home/runner/.local
            /home/runner/.ccm/scylla-repository
            /home/runner/.ccm/repository
            /home/runner/.sdkman
            testdata/pki
            bin/
          # CCM, scylla, cassandra and java versions are in Makefile
          key: pr-check-${{ runner.os }}-${{ hashFiles('Makefile') }}

      - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
        with:
          go-version-file: go.mod
          cache-dependency-path: |
            lz4/go.sum
            tests/bench/go.sum
            go.sum

      - name: Run linters
        run: make check

      - name: Run unit tests
        run: make test-unit

      - run: sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"

  test-integration-scylla:
    name: Integration Tests On Scylla
    runs-on: ubuntu-latest
    needs: build
    strategy:
      matrix:
        scylla-version: [LATEST, PRIOR, LTS-LATEST, LTS-PRIOR]
      fail-fast: false
    env:
      SCYLLA_VERSION: ${{ matrix.scylla-version }}
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

      - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
        with:
          python-version: '3.11'

      - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
        with:
          path: |
            /home/runner/.cache/pip
            /home/runner/.local
            /home/runner/.sdkman
            testdata/pki
            bin/
          # CCM, pip and java versions are in Makefile
          key: pr-check-${{ runner.os }}-${{ hashFiles('Makefile') }}

      - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
        with:
          go-version-file: go.mod
          cache-dependency-path: |
            lz4/go.sum
            tests/bench/go.sum
            go.sum

      - name: Get scylla version
        id: scylla-version
        run: make resolve-scylla-version

      - name: Pull CCM image from the cache
        uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
        if: steps.scylla-version.outputs.value != 'NOT-FOUND'
        id: ccm-cache
        with:
          path: ~/.ccm/repository
          key: ccm-scylla-${{ runner.os }}-${{ steps.scylla-version.outputs.value }}

      - name: Download ScyllaDB (${{ steps.scylla-version.outputs.value }}) image
        if: steps.ccm-cache.outputs.cache-hit != 'true' && steps.scylla-version.outputs.value != 'NOT-FOUND'
        run: make download-scylla

      - name: Save CCM ScyllaDB image into the cache
        if: steps.ccm-cache.outputs.cache-hit != 'true' && steps.scylla-version.outputs.value != 'NOT-FOUND'
        uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
        with:
          path: ~/.ccm/repository
          key: ccm-scylla-${{ runner.os }}-${{ steps.scylla-version.outputs.value }}

      - name: Run integration suite with ScyllaDB ${{ matrix.scylla-version }}(${{ steps.scylla-version.outputs.value }})
        if: steps.scylla-version.outputs.value != 'NOT-FOUND'
        run: make test-integration-scylla

      - name: Run CCM integration suite with ScyllaDB ${{ matrix.scylla-version }}(${{ steps.scylla-version.outputs.value }})
        if: steps.scylla-version.outputs.value != 'NOT-FOUND'
        run: TEST_INTEGRATION_TAGS="ccm gocql_debug" make test-integration-scylla

  test-integration-cassandra:
    name: Integration Tests On Cassandra
    runs-on: ubuntu-latest
    needs: build
    strategy:
      matrix:
        cassandra-version: [5-LATEST, 4-LATEST]
      fail-fast: false
    env:
      CASSANDRA_VERSION: ${{ matrix.cassandra-version }}

    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

      - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
        with:
          python-version: '3.11'

      - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
        with:
          path: |
            /home/runner/.cache/pip
            /home/runner/.local
            /home/runner/.sdkman
            testdata/pki
            bin/
          # CCM, python and java versions are in Makefile
          key: pr-check-${{ runner.os }}-${{ hashFiles('Makefile') }}

      - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
        with:
          go-version-file: go.mod
          cache-dependency-path: |
            lz4/go.sum
            tests/bench/go.sum
            go.sum

      - name: Get cassandra version
        id: cassandra-version
        run: make resolve-cassandra-version

      - name: Pull CCM image from the cache
        uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
        if: steps.cassandra-version.outputs.value != 'NOT-FOUND'
        id: ccm-cache
        with:
          path: ~/.ccm/repository
          key: ccm-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }}

      - name: Download Cassandra (${{ steps.cassandra-version.outputs.value }}) image
        if: steps.ccm-cache.outputs.cache-hit != 'true' && steps.cassandra-version.outputs.value != 'NOT-FOUND'
        run: make download-cassandra

      - name: Save CCM Cassandra image into the cache
        if: steps.ccm-cache.outputs.cache-hit != 'true' && steps.cassandra-version.outputs.value != 'NOT-FOUND'
        uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
        with:
          path: ~/.ccm/repository
          key: ccm-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }}

      - name: Run integration suite with Cassandra ${{ matrix.cassandra-version }}(${{ steps.cassandra-version.outputs.value }})
        if: steps.cassandra-version.outputs.value != 'NOT-FOUND'
        run: make test-integration-cassandra

      - name: Run CCM integration suite with Cassandra ${{ matrix.cassandra-version }}(${{ steps.cassandra-version.outputs.value }})
        if: steps.cassandra-version.outputs.value != 'NOT-FOUND'
        run: TEST_INTEGRATION_TAGS="ccm gocql_debug" make test-integration-cassandra



================================================
FILE: .gitignore
================================================
gocql-fuzz
fuzz-corpus
fuzz-work
gocql.test
.idea

bin/

testdata/pki/.keystore
testdata/pki/.truststore
testdata/pki/*.crt
testdata/pki/*.key
testdata/pki/*.p12

docs/_build/
docs/source/.doctrees

TODO*.md

# Codex - AI assistant metadata
.codex
.codex/
.codex-cache/
.codex-config.json
.codex-settings.json
codex.log
AGENTS.md

# Claude - AI assistant metadata
.anthropic/
.claude/
claude.log
claude_history.json
claude_config.json
CLAUDE.md

================================================
FILE: .golangci.yml
================================================
version: "2"

formatters:
  enable:
    - goimports

  settings:
    goimports:
      local-prefixes:
        - github.com/gocql/gocql
        - github.com/apache/cassandra-gocql-driver
        - github.com/apache/cassandra-gocql-driver/v2
    golines:
      max-len: 120

linters:
  exclusions:
    rules:
      - path: '(.+)_test\.go'
        text: "fieldalignment"
        linters:
          - govet

  default: none
  enable:
    - nolintlint
    - govet
  settings:
    govet:
      enable-all: true
      disable:
        - shadow

    nolintlint:
      allow-no-explanation: [ golines ]
      require-explanation: true
      require-specific: true

run:
  build-tags:
    - integration
    - unit

================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to the ScyllaDB GoCQL Driver

**TL;DR** - this manifesto sets out the bare minimum requirements for submitting a patch to gocql.

This guide outlines the process of landing patches in gocql and the general approach to maintaining the code base.

## Background

The goal of the gocql project is to provide a stable and robust CQL driver for Go. This is a community driven project that is coordinated by a small team of core developers.

## Minimum Requirement Checklist

The following is a check list of requirements that need to be satisfied in order for us to merge your patch:

* You should raise a pull request to scylladb/gocql on Github
* The pull request has a title that clearly summarizes the purpose of the patch
* The motivation behind the patch is clearly defined in the pull request summary
* You agree that your contribution is donated to the Apache Software Foundation (appropriate copyright is on all new files)
* The patch will merge cleanly
* The test coverage does not fall
* The merge commit passes the regression test suite on GitHub Actions
* `go fmt` has been applied to the submitted code
* A correctly formatted commit message, see below
* Notable changes (i.e. new features or changed behavior, bugfixes) are appropriately documented in CHANGELOG.md, functional changes also in godoc

If there are any requirements that can't be reasonably satisfied, please state this either on the pull request or as part of discussion on the mailing list. Where appropriate, the core team may apply discretion and make an exception to these requirements.

## Commit Message

The commit message format should be:

```
<short description>

<reason why the change is needed>

Patch by <authors>; reviewed by <Reviewers> for #####
```

Short description should:
* Be a short sentence.
* Start with a capital letter.
* Be written in the present tense.
* Summarize what is changed, not why it is changed.

Short description should not:
* End with a period.
* Use the word Fixes . Most commits fix something.

Long description / Reason:
* Should describe why the change is needed. What is fixed by the change? Why it it was broken before? What use case does the new feature solve?
* Consider adding details of other options that you considered when implementing the change and why you made the design decisions you made.

## Beyond The Checklist

In addition to stating the hard requirements, there are a bunch of things that we consider when assessing changes to the library. These soft requirements are helpful pointers of how to get a patch landed quicker and with less fuss.

### General QA Approach

The Scylla project needs to consider the ongoing maintainability of the library at all times. Patches that look like they will introduce maintenance issues for the team will not be accepted.

Your patch will get merged quicker if you have decent test cases that provide test coverage for the new behavior you wish to introduce.

Unit tests are good, integration tests are even better. An example of a unit test is `marshal_test.go` - this tests the serialization code in isolation. `cassandra_test.go` is an integration test suite that is executed against every version of Cassandra that gocql supports as part of the CI process on Travis.

That said, the point of writing tests is to provide a safety net to catch regressions, so there is no need to go overboard with tests. Remember that the more tests you write, the more code we will have to maintain. So there's a balance to strike there.

### Sign Off Procedure

Generally speaking, a pull request can get merged by any one of the project's committers. If your change is minor, chances are that one team member will just go ahead and merge it there and then. As stated earlier, suitable test coverage will increase the likelihood that a single reviewer will assess and merge your change. If your change has no test coverage, or looks like it may have wider implications for the health and stability of the library, the reviewer may elect to refer the change to another team member to achieve consensus before proceeding. Therefore, the tighter and cleaner your patch is, the quicker it will go through the review process.

### Supported Features

gocql is a low level wire driver for Cassandra CQL. By and large, we would like to keep the functional scope of the library as narrow as possible. We think that gocql should be tight and focused, and we will be naturally skeptical of things that could just as easily be implemented in a higher layer. Inevitably you will come across something that could be implemented in a higher layer, save for a minor change to the core API. In this instance, please strike up a conversation in the Cassandra community. Chances are we will understand what you are trying to achieve and will try to accommodate this in a maintainable way.


================================================
FILE: LICENSE
================================================

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.



================================================
FILE: Makefile
================================================
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eo pipefail -c

MAKEFILE_PATH := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
KEY_PATH = ${MAKEFILE_PATH}/testdata/pki
BIN_DIR := "${MAKEFILE_PATH}/bin"

CASSANDRA_VERSION ?= LATEST
SCYLLA_VERSION ?= LATEST

GOLANGCI_VERSION = 2.5.0

TEST_CQL_PROTOCOL ?= 4
TEST_COMPRESSOR ?= snappy
TEST_OPTS ?=
TEST_INTEGRATION_TAGS ?= integration gocql_debug
JVM_EXTRA_OPTS ?= -Dcassandra.test.fail_writes_ks=test -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler

CCM_CASSANDRA_CLUSTER_NAME = gocql_cassandra_integration_test
CCM_CASSANDRA_IP_PREFIX = 127.0.1.
CCM_CASSANDRA_REPO ?= github.com/apache/cassandra-ccm
CCM_CASSANDRA_VERSION ?= trunk

CCM_SCYLLA_CLUSTER_NAME = gocql_scylla_integration_test
CCM_SCYLLA_IP_PREFIX = 127.0.2.
CCM_SCYLLA_REPO ?= github.com/scylladb/scylla-ccm
CCM_SCYLLA_VERSION ?= master

ifeq (${CCM_CONFIG_DIR},)
	CCM_CONFIG_DIR = ~/.ccm
endif
CCM_CONFIG_DIR := $(shell readlink --canonicalize ${CCM_CONFIG_DIR})

CASSANDRA_CONFIG ?= "client_encryption_options.enabled: true" \
"client_encryption_options.keystore: ${KEY_PATH}/.keystore" \
"client_encryption_options.keystore_password: cassandra" \
"client_encryption_options.require_client_auth: true" \
"client_encryption_options.truststore: ${KEY_PATH}/.truststore" \
"client_encryption_options.truststore_password: cassandra" \
"concurrent_reads: 2" \
"concurrent_writes: 2" \
"write_request_timeout_in_ms: 5000" \
"read_request_timeout_in_ms: 5000"

ifeq (${CASSANDRA_VERSION},3-LATEST)
	CASSANDRA_CONFIG += "rpc_server_type: sync" \
"rpc_min_threads: 2" \
"rpc_max_threads: 2" \
"enable_user_defined_functions: true" \
"enable_materialized_views: true" \

else ifeq (${CASSANDRA_VERSION},4-LATEST)
	CASSANDRA_CONFIG +=	"enable_user_defined_functions: true" \
"enable_materialized_views: true"
else
	CASSANDRA_CONFIG += "user_defined_functions_enabled: true" \
"materialized_views_enabled: true"
endif

SCYLLA_CONFIG = "native_transport_port_ssl: 9142" \
"native_transport_port: 9042" \
"native_shard_aware_transport_port: 19042" \
"native_shard_aware_transport_port_ssl: 19142" \
"client_encryption_options.enabled: true" \
"client_encryption_options.certificate: ${KEY_PATH}/cassandra.crt" \
"client_encryption_options.keyfile: ${KEY_PATH}/cassandra.key" \
"client_encryption_options.truststore: ${KEY_PATH}/ca.crt" \
"client_encryption_options.require_client_auth: true" \
"maintenance_socket: workdir" \
"enable_tablets: true" \
"enable_user_defined_functions: true" \
"experimental_features: [udf]"

export JVM_EXTRA_OPTS
export JAVA11_HOME=${JAVA_HOME_11_X64}
export JAVA17_HOME=${JAVA_HOME_17_X64}
export JAVA_HOME=${JAVA_HOME_11_X64}
export PATH := $(MAKEFILE_PATH)/bin:~/.sdkman/bin:$(PATH)

print-config:
	echo ${CASSANDRA_CONFIG}

.prepare-bin:
	@[[ -d "$(MAKEFILE_PATH)/bin" ]] || mkdir "$(MAKEFILE_PATH)/bin"

.prepare-get-version: .prepare-bin
	@if [[ ! -f "$(MAKEFILE_PATH)/bin/get-version" ]]; then
		echo "bin/get-version is not found, installing it"
		curl -sSLo /tmp/get-version.zip https://github.com/scylladb-actions/get-version/releases/download/v0.4.5/get-version_0.4.5_linux_amd64v3.zip
		unzip /tmp/get-version.zip get-version -d "$(MAKEFILE_PATH)/bin" >/dev/null
	fi

.prepare-environment-update-aio-max-nr:
	@if (( $$(< /proc/sys/fs/aio-max-nr) < 2097152 )); then
		echo 2097152 | sudo tee /proc/sys/fs/aio-max-nr >/dev/null
	fi

clean-old-temporary-docker-images:
	@echo "Running Docker Hub image cleanup script..."
	python ci/clean-old-temporary-docker-images.py

CASSANDRA_VERSION_FILE=/tmp/cassandra-version-${CASSANDRA_VERSION}.resolved
resolve-cassandra-version: .prepare-get-version
	@find "${CASSANDRA_VERSION_FILE}" -mtime +0 -delete 2>/dev/null 1>&1 || true
	if [[ -f "${CASSANDRA_VERSION_FILE}" ]]; then
		echo "Resolved Cassandra ${CASSANDRA_VERSION} to $$(cat ${CASSANDRA_VERSION_FILE})"
		exit 0
	fi

	if [[ "${CASSANDRA_VERSION}" == "LATEST" ]]; then
		CASSANDRA_VERSION_RESOLVED=`get-version -source github-tag -repo apache/cassandra -prefix "cassandra-" -out-no-prefix -filters "^[0-9]+$$.^[0-9]+$$.^[0-9]+$$ and LAST.LAST.LAST" | tr -d '\"'`
	elif [[ "${CASSANDRA_VERSION}" == "5-LATEST" ]]; then
		CASSANDRA_VERSION_RESOLVED=`get-version -source github-tag -repo apache/cassandra -prefix "cassandra-" -out-no-prefix -filters "^[0-9]+$$.^[0-9]+$$.^[0-9]+$$ and 5.LAST.LAST" | tr -d '\"'`
	elif [[ "${CASSANDRA_VERSION}" == "4-LATEST" ]]; then
		CASSANDRA_VERSION_RESOLVED=`get-version -source github-tag -repo apache/cassandra -prefix "cassandra-" -out-no-prefix -filters "^[0-9]+$$.^[0-9]+$$.^[0-9]+$$ and 4.LAST.LAST" | tr -d '\"'`
	elif [[ "${CASSANDRA_VERSION}" == "3-LATEST" ]]; then
		CASSANDRA_VERSION_RESOLVED=`get-version -source github-tag -repo apache/cassandra -prefix "cassandra-" -out-no-prefix -filters "^[0-9]+$$.^[0-9]+$$.^[0-9]+$$ and 3.LAST.LAST" | tr -d '\"'`
	elif echo "${CASSANDRA_VERSION}" | grep -P '^[0-9\.]+'; then
		CASSANDRA_VERSION_RESOLVED=${CASSANDRA_VERSION}
	else
		echo "Unknown Cassandra version name '${CASSANDRA_VERSION}'"
		exit 1
	fi

	if [[ -z "$${CASSANDRA_VERSION_RESOLVED}" ]]; then
		echo "There is no ${CASSANDRA_VERSION} Cassandra version"
		if [[ -n "$${GITHUB_ENV}" ]]; then
			echo "value=NOT-FOUND" >>$${GITHUB_OUTPUT}
			echo "CASSANDRA_VERSION_RESOLVED=NOT-FOUND" >>$${GITHUB_ENV}
			exit 0
		fi
		exit 2
	fi

	echo "Resolved Cassandra ${CASSANDRA_VERSION} to $${CASSANDRA_VERSION_RESOLVED}"
	if [[ -n "$${GITHUB_OUTPUT}" ]]; then
		echo "value=$${CASSANDRA_VERSION_RESOLVED}" >>$${GITHUB_OUTPUT}
	fi
	if [[ -n "$${GITHUB_ENV}" ]]; then
		echo "CASSANDRA_VERSION_RESOLVED=$${CASSANDRA_VERSION_RESOLVED}" >>$${GITHUB_ENV}
	fi
	echo "$${CASSANDRA_VERSION_RESOLVED}" >${CASSANDRA_VERSION_FILE}

SCYLLA_VERSION_FILE=/tmp/scylla-version-${SCYLLA_VERSION}.resolved
resolve-scylla-version: .prepare-get-version
	@find "${SCYLLA_VERSION_FILE}" -mtime +0 -delete 2>/dev/null 1>&1 || true
	if [[ -f "${SCYLLA_VERSION_FILE}" ]]; then
		echo "Resolved ScyllaDB ${SCYLLA_VERSION} to $$(cat ${SCYLLA_VERSION_FILE})"
		exit 0
	fi

	if [[ "${SCYLLA_VERSION}" == "LTS-LATEST" ]]; then
		SCYLLA_VERSION_RESOLVED=`get-version --source dockerhub-imagetag --repo scylladb/scylla -filters "^[0-9]{4}$$.^[0-9]+$$.^[0-9]+$$ and LAST.1.LAST" | tr -d '\"'`
	elif [[ "${SCYLLA_VERSION}" == "LTS-PRIOR" ]]; then
		SCYLLA_VERSION_RESOLVED=`get-version --source dockerhub-imagetag --repo scylladb/scylla -filters "^[0-9]{4}$$.^[0-9]+$$.^[0-9]+$$ and LAST-1.1.LAST" | tr -d '\"'`
		if [[ -z "$${SCYLLA_VERSION_RESOLVED}" ]]; then
			SCYLLA_VERSION_RESOLVED=`get-version --source dockerhub-imagetag --repo scylladb/scylla-enterprise -filters "^[0-9]{4}$$.^[0-9]+$$.^[0-9]+$$ and LAST-1.1.LAST" | tr -d '\"'`
		fi
	elif [[ "${SCYLLA_VERSION}" == "LATEST" ]]; then
		SCYLLA_VERSION_RESOLVED=`get-version --source dockerhub-imagetag --repo scylladb/scylla -filters "^[0-9]{4}$$.^[0-9]+$$.^[0-9]+$$ and LAST.LAST.LAST" | tr -d '\"'`
	elif [[ "${SCYLLA_VERSION}" == "PRIOR" ]]; then
		SCYLLA_VERSION_RESOLVED=`get-version --source dockerhub-imagetag --repo scylladb/scylla -filters "^[0-9]{4}$$.^[0-9]+$$.^[0-9]+$$ and LAST.LAST.LAST-1" | tr -d '\"'`
	elif echo "${SCYLLA_VERSION}" | grep -P '^[0-9\.]+'; then
		SCYLLA_VERSION_RESOLVED=${SCYLLA_VERSION}
	else
		echo "Unknown ScyllaDB version name '${SCYLLA_VERSION}'"
		exit 1
	fi

	if [[ -z "$${SCYLLA_VERSION_RESOLVED}" ]]; then
		echo "There is no ${SCYLLA_VERSION} ScyllaDB version"
		if [[ -n "$${GITHUB_ENV}" ]]; then
			echo "value=NOT-FOUND" >>$${GITHUB_OUTPUT}
			echo "SCYLLA_VERSION_RESOLVED=NOT-FOUND" >>$${GITHUB_ENV}
			exit 0
		fi
		exit 2
	fi

	echo "Resolved ScyllaDB ${SCYLLA_VERSION} to $${SCYLLA_VERSION_RESOLVED}"
	if [[ -n "$${GITHUB_OUTPUT}" ]]; then
		echo "value=$${SCYLLA_VERSION_RESOLVED}" >>$${GITHUB_OUTPUT}
	fi
	if [[ -n "$${GITHUB_ENV}" ]]; then
		echo "SCYLLA_VERSION_RESOLVED=$${SCYLLA_VERSION_RESOLVED}" >>$${GITHUB_ENV}
	fi
	echo "$${SCYLLA_VERSION_RESOLVED}" >${SCYLLA_VERSION_FILE}

cassandra-start: .prepare-pki .prepare-cassandra-ccm .prepare-java resolve-cassandra-version
	@if [ -d ${CCM_CONFIG_DIR}/${CCM_CASSANDRA_CLUSTER_NAME} ] && ccm switch ${CCM_CASSANDRA_CLUSTER_NAME} 2>/dev/null 1>&2 && ccm status | grep UP 2>/dev/null 1>&2; then
		echo "Cassandra cluster is already started"
		exit 0
	fi
	if [[ -z "$${CASSANDRA_VERSION_RESOLVED}" ]]; then
		CASSANDRA_VERSION_RESOLVED=$$(cat '${CASSANDRA_VERSION_FILE}')
	fi
	if [[ -z "$${CASSANDRA_VERSION_RESOLVED}" ]]; then
		echo "Cassandra version ${CASSANDRA_VERSION} was not resolved"
		exit 1
	fi
	source ~/.sdkman/bin/sdkman-init.sh;
	echo "Start Cassandra ${CASSANDRA_VERSION}($${CASSANDRA_VERSION_RESOLVED}) cluster"
	ccm stop ${CCM_CASSANDRA_CLUSTER_NAME} 2>/dev/null 1>&2 || true
	ccm remove ${CCM_CASSANDRA_CLUSTER_NAME} 2>/dev/null 1>&2 || true
	ccm create ${CCM_CASSANDRA_CLUSTER_NAME} -i ${CCM_CASSANDRA_IP_PREFIX} -v "$${CASSANDRA_VERSION_RESOLVED}" -n3 -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
	ccm updateconf ${CASSANDRA_CONFIG}
	for conf_dir in ${CCM_CONFIG_DIR}/${CCM_CASSANDRA_CLUSTER_NAME}/node*/conf; do \
		sed -i 's/^#MAX_HEAP_SIZE=.*/MAX_HEAP_SIZE="256M"/' "$$conf_dir/cassandra-env.sh"; \
	done
	ccm start --wait-for-binary-proto --wait-other-notice --verbose
	ccm status
	ccm node1 nodetool status

scylla-start: .prepare-pki .prepare-scylla-ccm .prepare-environment-update-aio-max-nr resolve-scylla-version
	@if [ -d ${CCM_CONFIG_DIR}/${CCM_SCYLLA_CLUSTER_NAME} ] && ccm switch ${CCM_SCYLLA_CLUSTER_NAME} 2>/dev/null 1>&2 && ccm status | grep UP 2>/dev/null 1>&2; then
		echo "Scylla cluster is already started";
		exit 0;
	fi
	if [[ -z "$${SCYLLA_VERSION_RESOLVED}" ]]; then
		SCYLLA_VERSION_RESOLVED=$$(cat '${SCYLLA_VERSION_FILE}')
	fi
	if [[ -z "$${SCYLLA_VERSION_RESOLVED}" ]]; then
		echo "ScyllaDB version ${SCYLLA_VERSION} was not resolved"
		exit 1
	fi
	echo "Start scylla $(SCYLLA_VERSION)($${SCYLLA_VERSION_RESOLVED}) cluster"
	ccm stop ${CCM_SCYLLA_CLUSTER_NAME} 2>/dev/null 1>&2 || true
	ccm remove ${CCM_SCYLLA_CLUSTER_NAME} 2>/dev/null 1>&2 || true
	if [[ "$${SCYLLA_VERSION_RESOLVED}" != *:* ]]; then
		SCYLLA_VERSION_RESOLVED="release:$${SCYLLA_VERSION_RESOLVED}"
	fi
	ccm create ${CCM_SCYLLA_CLUSTER_NAME} -i ${CCM_SCYLLA_IP_PREFIX} --scylla -v $${SCYLLA_VERSION_RESOLVED} -n 3 -d --jvm_arg="--smp 2 --memory 1G --experimental-features udf --enable-user-defined-functions true"
	ccm updateconf ${SCYLLA_CONFIG}
	ccm start --wait-for-binary-proto --wait-other-notice --verbose
	ccm status
	ccm node1 nodetool status
	sudo chmod 0777 ${CCM_CONFIG_DIR}/${CCM_SCYLLA_CLUSTER_NAME}/*/cql.m || true

download-cassandra: .prepare-cassandra-ccm resolve-cassandra-version
	@if [[ -z "$${CASSANDRA_VERSION_RESOLVED}" ]]; then
		CASSANDRA_VERSION_RESOLVED=$$(cat '${CASSANDRA_VERSION_FILE}')
	fi
	if [[ -z "$${CASSANDRA_VERSION_RESOLVED}" ]]; then
		echo "Cassandra version ${CASSANDRA_VERSION} was not resolved"
		exit 1
	fi
	rm -rf /tmp/download.ccm || true
	mkdir /tmp/download.ccm || true
	ccm create ccm_1 -i 127.0.254. -n 1:0 -v "$${CASSANDRA_VERSION_RESOLVED}" --config-dir=/tmp/download.ccm
	rm -rf /tmp/download.ccm

download-scylla: .prepare-scylla-ccm resolve-scylla-version
	@if [[ -z "$${SCYLLA_VERSION_RESOLVED}" ]]; then
		SCYLLA_VERSION_RESOLVED=$$(cat '${SCYLLA_VERSION_FILE}')
	fi
	if [[ -z "$${SCYLLA_VERSION_RESOLVED}" ]]; then
		echo "ScyllaDB version ${SCYLLA_VERSION} was not resolved"
		exit 1
	fi
	rm -rf /tmp/download.ccm || true
	mkdir /tmp/download.ccm || true
	if [[ "$${SCYLLA_VERSION_RESOLVED}" != *:* ]]; then
		SCYLLA_VERSION_RESOLVED="release:$${SCYLLA_VERSION_RESOLVED}"
	fi
	ccm create ccm_1 -i 127.0.254. -n 1:0 -v "$${SCYLLA_VERSION_RESOLVED}" --scylla --config-dir=/tmp/download.ccm
	rm -rf /tmp/download.ccm

cassandra-stop: .prepare-cassandra-ccm
	@echo "Stop cassandra cluster"
	@ccm stop --not-gently ${CCM_CASSANDRA_CLUSTER_NAME} 2>/dev/null 1>&2 || true
	@ccm remove ${CCM_CASSANDRA_CLUSTER_NAME} 2>/dev/null 1>&2 || true

scylla-stop: .prepare-scylla-ccm
	@echo "Stop scylla cluster"
	@ccm stop --not-gently ${CCM_SCYLLA_CLUSTER_NAME} 2>/dev/null 1>&2 || true
	@ccm remove ${CCM_SCYLLA_CLUSTER_NAME} 2>/dev/null 1>&2 || true

test-integration-cassandra: cassandra-start
	@echo "Run integration tests for proto ${TEST_CQL_PROTOCOL} on cassandra ${CASSANDRA_VERSION}"
	if [[ -z "$${CASSANDRA_VERSION_RESOLVED}" ]]; then
		CASSANDRA_VERSION_RESOLVED=$$(cat '${CASSANDRA_VERSION_FILE}')
	fi
	if [[ -z "$${CASSANDRA_VERSION_RESOLVED}" ]]; then
		echo "Cassandra version ${CASSANDRA_VERSION} was not resolved"
		exit 1
	fi
	echo "go test -v ${TEST_OPTS} -tags \"${TEST_INTEGRATION_TAGS}\" -distribution cassandra -timeout=10m -runauth -gocql.timeout=60s -runssl -proto=${TEST_CQL_PROTOCOL} -rf=3 -clusterSize=3 -autowait=2000ms -compressor=${TEST_COMPRESSOR} -gocql.cversion=$${CASSANDRA_VERSION_RESOLVED} -cluster=$$(ccm liveset) ./..."
	go test -v ${TEST_OPTS} -tags "${TEST_INTEGRATION_TAGS}" -distribution cassandra -timeout=10m -runauth -gocql.timeout=60s -runssl -proto=${TEST_CQL_PROTOCOL} -rf=3 -clusterSize=3 -autowait=2000ms -compressor=${TEST_COMPRESSOR} -gocql.cversion=$$(ccm node1 versionfrombuild) -cluster=$$(ccm liveset) ./...

test-integration-scylla: scylla-start
	@echo "Run integration tests for proto ${TEST_CQL_PROTOCOL} on scylla ${SCYLLA_VERSION}"
	if [ -S "${CCM_CONFIG_DIR}/${CCM_SCYLLA_CLUSTER_NAME}/node1/cql.m" ]; then
		CLUSTER_SOCKET="-cluster-socket ${CCM_CONFIG_DIR}/${CCM_SCYLLA_CLUSTER_NAME}/node1/cql.m"
	else
		echo "Cluster socket is not found"
	fi
	if [[ -z "$${SCYLLA_VERSION_RESOLVED}" ]]; then
		SCYLLA_VERSION_RESOLVED=$$(cat '${SCYLLA_VERSION_FILE}')
	fi
	if [[ -z "$${SCYLLA_VERSION_RESOLVED}" ]]; then
		echo "ScyllaDB version ${SCYLLA_VERSION} was not resolved"
		exit 1
	fi
	echo "go test -v ${TEST_OPTS} -tags \"${TEST_INTEGRATION_TAGS}\" -distribution scylla $${CLUSTER_SOCKET} -timeout=5m -gocql.timeout=60s -proto=${TEST_CQL_PROTOCOL} -rf=3 -clusterSize=3 -autowait=2000ms -compressor=${TEST_COMPRESSOR} -gocql.cversion=$${SCYLLA_VERSION_RESOLVED} -cluster=$$(ccm liveset) ./..."
	go test -v ${TEST_OPTS} -tags "${TEST_INTEGRATION_TAGS}" -distribution scylla $${CLUSTER_SOCKET} -timeout=5m -gocql.timeout=60s -proto=${TEST_CQL_PROTOCOL} -rf=3 -clusterSize=3 -autowait=2000ms -compressor=${TEST_COMPRESSOR} -gocql.cversion=$${SCYLLA_VERSION_RESOLVED} -cluster=$$(ccm liveset) ./...

test-unit: .prepare-pki
	@echo "Run unit tests"
	go clean -testcache
ifeq ($(shell if [[ -n "$${GITHUB_STEP_SUMMARY}" ]]; then echo "running-in-workflow"; else echo "running-in-shell"; fi), running-in-workflow)
	echo "### Unit Test Results" >>$${GITHUB_STEP_SUMMARY}
	echo '```' >>$${GITHUB_STEP_SUMMARY}
	echo go test -tags unit -timeout=5m -race ./...
	go test -tags unit -timeout=5m -race ./... | tee -a "$${GITHUB_STEP_SUMMARY}"; TEST_STATUS=$${PIPESTATUS[0]}; echo '```' >>"$${GITHUB_STEP_SUMMARY}"; exit "$${TEST_STATUS}"
else
	go test -v -tags unit -timeout=5m -race ./...
endif

test-bench:
	@echo "Run benchmark tests"
ifeq ($(shell if [[ -n "$${GITHUB_STEP_SUMMARY}" ]]; then echo "running-in-workflow"; else echo "running-in-shell"; fi), running-in-workflow)
	echo "### Benchmark Results" >>$${GITHUB_STEP_SUMMARY}
	echo '```' >>"$${GITHUB_STEP_SUMMARY}"
	echo go test -bench=. -benchmem ./...
	go test -bench=. -benchmem ./... | tee -a >>"$${GITHUB_STEP_SUMMARY}"
	echo '```' >>"$${GITHUB_STEP_SUMMARY}"
else
	go test -bench=. -benchmem ./...
endif

check-go-mod-drift:
	@echo "Check Go module drift"
	go mod tidy -diff
	go mod tidy -C lz4 -diff
	go mod tidy -C tests/bench -diff

check: .prepare-golangci check-go-mod-drift
	@echo "Build"
	go build -tags all .
	echo "Check linting"
	${BIN_DIR}/golangci-lint run

fix-go-mod-drift:
	@echo "Fix Go module drift"
	go mod tidy
	go mod tidy -C lz4
	go mod tidy -C tests/bench

fix: .prepare-golangci fix-go-mod-drift
	@echo "Fix linting"
	${BIN_DIR}/golangci-lint run --fix

.prepare-java:
ifeq ($(shell if [ -f ~/.sdkman/bin/sdkman-init.sh ]; then echo "installed"; else echo "not-installed"; fi), not-installed)
	@$(MAKE) install-java
endif

install-java:
	@echo "Installing SDKMAN..."
	curl -s "https://get.sdkman.io" | bash
	echo "sdkman_auto_answer=true" >> ~/.sdkman/etc/config
	source ~/.sdkman/bin/sdkman-init.sh;
	echo "Installing Java versions...";
	sdk install java 11.0.30-zulu;
	sdk install java 17.0.18-zulu;
	sdk default java 11.0.30-zulu;
	sdk use java 11.0.30-zulu;

.prepare-cassandra-ccm:
	@if command -v ccm >/dev/null 2>&1 && grep CASSANDRA ${CCM_CONFIG_DIR}/ccm-type 2>/dev/null 1>&2 && grep ${CCM_CASSANDRA_VERSION} ${CCM_CONFIG_DIR}/ccm-version 2>/dev//null  1>&2; then
		echo "Cassandra CCM ${CCM_CASSANDRA_VERSION} is already installed";
		exit 0
	fi
	$(MAKE) install-cassandra-ccm

install-cassandra-ccm:
	@echo "Install CCM ${CCM_CASSANDRA_VERSION}"
	pip install "git+https://${CCM_CASSANDRA_REPO}.git@${CCM_CASSANDRA_VERSION}"
	mkdir ${CCM_CONFIG_DIR} 2>/dev/null || true
	echo CASSANDRA > ${CCM_CONFIG_DIR}/ccm-type
	echo ${CCM_CASSANDRA_VERSION} > ${CCM_CONFIG_DIR}/ccm-version

.prepare-scylla-ccm:
	@if command -v ccm >/dev/null 2>&1 && grep SCYLLA ${CCM_CONFIG_DIR}/ccm-type 2>/dev/null 1>&2 && grep ${CCM_SCYLLA_VERSION} ${CCM_CONFIG_DIR}/ccm-version 2>/dev//null  1>&2; then
		echo "Scylla CCM ${CCM_SCYLLA_VERSION} is already installed";
		exit 0
	fi
	$(MAKE) install-scylla-ccm

install-scylla-ccm:
	@echo "Installing Scylla CCM ${CCM_SCYLLA_VERSION}"
	pip install "git+https://${CCM_SCYLLA_REPO}.git@${CCM_SCYLLA_VERSION}"
	mkdir ${CCM_CONFIG_DIR} 2>/dev/null || true
	echo SCYLLA > ${CCM_CONFIG_DIR}/ccm-type
	echo ${CCM_SCYLLA_VERSION} > ${CCM_CONFIG_DIR}/ccm-version

.prepare-pki:
	@[ -f "testdata/pki/cassandra.key" ] || (echo "Generating new PKI" && cd testdata/pki/ && bash ./generate_certs.sh)

generate-pki:
	@echo "Generating new PKI"
	rm -f testdata/pki/.keystore testdata/pki/.truststore testdata/pki/*.p12 testdata/pki/*.key testdata/pki/*.crt || true
	cd testdata/pki/ && bash ./generate_certs.sh

.prepare-golangci:
	@if ! "${BIN_DIR}/golangci-lint" --version | grep '${GOLANGCI_VERSION}' >/dev/null 2>&1 ; then
		mkdir -p "${BIN_DIR}"
		echo "Installing golangci-lint to '${BIN_DIR}'"
		curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b bin/ v$(GOLANGCI_VERSION)
	fi


================================================
FILE: NOTICE
================================================
ScyllaDB GoCQL Driver
Copyright 2024 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).


This product originates, before git sha
34fdeebefcbf183ed7f916f931aa0586fdaa1b40, from software from the
Gocql Authors, with copyright and license as follows:

Copyright (c) 2016, The Gocql authors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Where The Gocql Authors for copyright purposes are below. Those marked with
asterisk have agreed to donate (copyright assign) their contributions to the
Apache Software Foundation, signing CLAs when appropriate.

Christoph Hack <christoph@tux21b.org>
Jonathan Rudenberg <jonathan@titanous.com> *
Thorsten von Eicken <tve@rightscale.com> *
Matt Robenolt <mattr@disqus.com>
Phillip Couto <phillip.couto@stemstudios.com> *
Niklas Korz <korz.niklask@gmail.com>
Nimi Wariboko Jr <nimi@channelmeter.com>
Ghais Issa <ghais.issa@gmail.com> *
Sasha Klizhentas <klizhentas@gmail.com>
Konstantin Cherkasov <k.cherkasoff@gmail.com>
Ben Hood <0x6e6562@gmail.com>
Pete Hopkins <phopkins@gmail.com>
Chris Bannister <c.bannister@gmail.com> *
Maxim Bublis <b@codemonkey.ru>
Alex Zorin <git@zor.io>
Kasper Middelboe Petersen <me@phant.dk>
Harpreet Sawhney <harpreet.sawhney@gmail.com>
Charlie Andrews <charlieandrews.cwa@gmail.com> *
Stanislavs Koikovs <stanislavs.koikovs@gmail.com>
Dan Forest <bonjour@dan.tf>
Miguel Serrano <miguelvps@gmail.com> *
Stefan Radomski <gibheer@zero-knowledge.org>
Josh Wright <jshwright@gmail.com>
Jacob Rhoden <jacob.rhoden@gmail.com>
Ben Frye <benfrye@gmail.com>
Fred McCann <fred@sharpnoodles.com> *
Dan Simmons <dan@simmons.io> *
Muir Manders <muir@retailnext.net>
Sankar P <sankar.curiosity@gmail.com> *
Julien Da Silva <julien.dasilva@gmail.com>
Dan Kennedy <daniel@firstcs.co.uk> *
Nick Dhupia<nick.dhupia@gmail.com>
Yasuharu Goto <matope.ono@gmail.com> *
Jeremy Schlatter <jeremy.schlatter@gmail.com> *
Matthias Kadenbach <matthias.kadenbach@gmail.com>
Dean Elbaz <elbaz.dean@gmail.com>
Mike Berman <evencode@gmail.com>
Dmitriy Fedorenko <c0va23@gmail.com> *
Zach Marcantel <zmarcantel@gmail.com>
James Maloney <jamessagan@gmail.com>
Ashwin Purohit <purohit@gmail.com> *
Dan Kinder <dkinder.is.me@gmail.com> *
Oliver Beattie <oliver@obeattie.com> *
Justin Corpron <jncorpron@gmail.com> *
Miles Delahunty <miles.delahunty@gmail.com>
Zach Badgett <zach.badgett@gmail.com>
Maciek Sakrejda <maciek@heroku.com> *
Jeff Mitchell <jeffrey.mitchell@gmail.com>
Baptiste Fontaine <b@ptistefontaine.fr> *
Matt Heath <matt@mattheath.com> *
Jamie Cuthill <jamie.cuthill@gmail.com>
Adrian Casajus <adriancasajus@gmail.com> *
John Weldon <johnweldon4@gmail.com> *
Adrien Bustany <adrien@bustany.org> *
Andrey Smirnov <smirnov.andrey@gmail.com> *
Adam Weiner <adamsweiner@gmail.com> *
Daniel Cannon <daniel@danielcannon.co.uk>
Johnny Bergström <johnny@joonix.se>
Adriano Orioli <orioli.adriano@gmail.com> *
Claudiu Raveica <claudiu.raveica@gmail.com> *
Artem Chernyshev <artem.0xD2@gmail.com> *
Ference Fu <fym201@msn.com>
LOVOO <opensource@lovoo.com>
nikandfor <nikandfor@gmail.com> *
Anthony Woods <awoods@raintank.io> *
Alexander Inozemtsev <alexander.inozemtsev@gmail.com> *
Rob McColl <rob@robmccoll.com>; <rmccoll@ionicsecurity.com> *
Viktor Tönköl <viktor.toenkoel@motionlogic.de> *
Ian Lozinski <ian.lozinski@gmail.com>
Michael Highstead <highstead@gmail.com> *
Sarah Brown <esbie.is@gmail.com> *
Caleb Doxsey <caleb@datadoghq.com> *
Frederic Hemery <frederic.hemery@datadoghq.com> *
Pekka Enberg <penberg@scylladb.com> *
Mark M <m.mim95@gmail.com>
Bartosz Burclaf <burclaf@gmail.com> *
Marcus King <marcusking01@gmail.com> *
Andrew de Andrade <andrew@deandrade.com.br>
Robert Nix <robert@nicerobot.org>
Nathan Youngman <git@nathany.com> *
Charles Law <charles.law@gmail.com>; <claw@conduce.com> *
Nathan Davies <nathanjamesdavies@gmail.com> *
Bo Blanton <bo.blanton@gmail.com>
Vincent Rischmann <me@vrischmann.me> *
Jesse Claven <jesse.claven@gmail.com> *
Derrick Wippler <thrawn01@gmail.com>
Leigh McCulloch <leigh@leighmcculloch.com>
Ron Kuris <swcafe@gmail.com>
Raphael Gavache <raphael.gavache@gmail.com> *
Yasser Abdolmaleki <yasser@yasser.ca>
Krishnanand Thommandra <devtkrishna@gmail.com>
Blake Atkinson <me@blakeatkinson.com>
Dharmendra Parsaila <d4dharmu@gmail.com>
Nayef Ghattas <nayef.ghattas@datadoghq.com> *
Michał Matczuk <mmatczuk@gmail.com> *
Ben Krebsbach <ben.krebsbach@gmail.com> *
Vivian Mathews <vivian.mathews.3@gmail.com> *
Sascha Steinbiss <satta@debian.org> *
Seth Rosenblum <seth.t.rosenblum@gmail.com> *
Javier Zunzunegui <javier.zunzunegui.b@gmail.com>
Luke Hines <lukehines@protonmail.com> *
Zhixin Wen <john.wenzhixin@hotmail.com> *
Chang Liu <changliu.it@gmail.com>
Ingo Oeser <nightlyone@gmail.com> *
Luke Hines <lukehines@protonmail.com>
Jacob Greenleaf <jacob@jacobgreenleaf.com>
Alex Lourie <alex@instaclustr.com>; <djay.il@gmail.com> *
Marco Cadetg <cadetg@gmail.com> *
Karl Matthias <karl@matthias.org> *
Thomas Meson <zllak@hycik.org> *
Martin Sucha <martin.sucha@kiwi.com>; <git@mm.ms47.eu> *
Pavel Buchinchik <p.buchinchik@gmail.com>
Rintaro Okamura <rintaro.okamura@gmail.com> *
Yura Sokolov <y.sokolov@joom.com>; <funny.falcon@gmail.com>
Jorge Bay <jorgebg@apache.org> *
Dmitriy Kozlov <hummerd@mail.ru> *
Alexey Romanovsky <alexus1024+gocql@gmail.com>
Jaume Marhuenda Beltran <jaumemarhuenda@gmail.com>
Piotr Dulikowski <piodul@scylladb.com>
Árni Dagur <arni@dagur.eu> *
Tushar Das <tushar.das5@gmail.com> *
Maxim Vladimirskiy <horkhe@gmail.com> *
Bogdan-Ciprian Rusu <bogdanciprian.rusu@crowdstrike.com> *
Yuto Doi <yutodoi.seattle@gmail.com> *
Krishna Vadali <tejavadali@gmail.com>
Jens-W. Schicke-Uffmann <drahflow@gmx.de> *
Ondrej Polakovič <ondrej.polakovic@kiwi.com> *
Sergei Karetnikov <sergei.karetnikov@gmail.com> *
Stefan Miklosovic <smiklosovic@apache.org> *
Adam Burk <amburk@gmail.com> *
Valerii Ponomarov <kiparis.kh@gmail.com> *
Neal Turett <neal.turett@datadoghq.com> *
Doug Schaapveld <djschaap@gmail.com> *
Steven Seidman <steven.seidman@datadoghq.com>
Wojciech Przytuła <wojciech.przytula@scylladb.com> *
João Reis <joao.reis@datastax.com> *
Lauro Ramos Venancio <lauro.venancio@incognia.com>
Dmitry Kropachev <dmitry.kropachev@gmail.com>
Oliver Boyle <pleasedontspamme4321+gocql@gmail.com> *
Jackson Fleming <jackson.fleming@instaclustr.com> *
Sylwia Szunejko <sylwia.szunejko@scylladb.com> *


================================================
FILE: README.md
================================================
<div align="center">

![Build Passing](https://github.com/scylladb/gocql/workflows/Build/badge.svg)
[![Read the Fork Driver Docs](https://img.shields.io/badge/Read_the_Docs-pkg_go-blue)](https://pkg.go.dev/github.com/scylladb/gocql#section-documentation)
[![Protocol Specs](https://img.shields.io/badge/Protocol_Specs-ScyllaDB_Docs-blue)](https://github.com/scylladb/scylladb/blob/master/docs/dev/protocol-extensions.md)

</div>

<h1 align="center">

Scylla Shard-Aware Fork of [apache/cassandra-gocql-driver](https://github.com/apache/cassandra-gocql-driver)

</h1>


<img src="./.github/assets/logo.svg" width="200" align="left" />

This is a fork of [apache/cassandra-gocql-driver](https://github.com/apache/cassandra-gocql-driver) package that we created at Scylla.
It contains extensions to tokenAwareHostPolicy supported by the Scylla 2.3 and onwards.
It allows driver to select a connection to a particular shard on a host based on the token.
This eliminates passing data between shards and significantly reduces latency.

There are open pull requests to merge the functionality to the upstream project:

* [gocql/gocql#1210](https://github.com/gocql/gocql/pull/1210)
* [gocql/gocql#1211](https://github.com/gocql/gocql/pull/1211).

It also provides support for shard aware ports, a faster way to connect to all shards, details available in [blogpost](https://www.scylladb.com/2021/04/27/connect-faster-to-scylla-with-a-shard-aware-port/).

---

### Table of Contents

- [1. Sunsetting Model](#1-sunsetting-model)
- [2. Installation](#2-installation)
- [3. Quick Start](#3-quick-start)
- [4. Data Types](#4-data-types)
- [5. Configuration](#5-configuration)
  - [5.1 Shard-aware port](#51-shard-aware-port)
  - [5.2 Client routes (PrivateLink)](#52-client-routes-privatelink)
  - [5.3 Iterator](#53-iterator)
- [6. Contributing](#6-contributing)

## 1. Sunsetting Model

> [!WARNING]
> In general, the gocql team will focus on supporting the current and previous versions of Go. gocql may still work with older versions of Go, but official support for these versions will have been sunset.

## 2. Installation

This is a drop-in replacement to gocql, it reuses the `github.com/gocql/gocql` import path.

Add the following line to your project `go.mod` file.

```mod
replace github.com/gocql/gocql => github.com/scylladb/gocql latest
```

and run

```sh
go mod tidy
```

to evaluate `latest` to a concrete tag.

Your project now uses the Scylla driver fork, make sure you are using the `TokenAwareHostPolicy` to enable the shard-awareness, continue reading for details.

## 3. Quick Start

Spawn a ScyllaDB Instance using Docker Run command:

```sh
docker run --name node1 --network your-network -p "9042:9042" -d scylladb/scylla:6.1.2 \
	--overprovisioned 1 \
	--smp 1
```

Then, create a new connection using ScyllaDB GoCQL following the example below:

```go
package main

import (
    "fmt"
    "github.com/gocql/gocql"
)

func main() {
    var cluster = gocql.NewCluster("localhost:9042")

    var session, err = cluster.CreateSession()
    if err != nil {
        panic("Failed to connect to cluster")
    }

    defer session.Close()

    var query = session.Query("SELECT * FROM system.clients")

    if rows, err := query.Iter().SliceMap(); err == nil {
        for _, row := range rows {
            fmt.Printf("%v\n", row)
        }
    } else {
        panic("Query error: " + err.Error())
    }
}
```

`SliceMap()` consumes and closes the iterator before it returns.

## 4. Data Types

Here's an list of all CQL Types reflected in the GoCQL environment:

| ScyllaDB Type    | Go Type            |
| ---------------- | ------------------ |
| `ascii`          | `string`           |
| `bigint`         | `int64`            |
| `blob`           | `[]byte`           |
| `boolean`        | `bool`             |
| `date`           | `time.Time`        |
| `decimal`        | `inf.Dec`          |
| `double`         | `float64`          |
| `duration`       | `gocql.Duration`   |
| `float`          | `float32`          |
| `uuid`           | `gocql.UUID`       |
| `int`            | `int32`            |
| `inet`           | `string`           |
| `list<int>`      | `[]int32`          |
| `map<int, text>` | `map[int32]string` |
| `set<int>`       | `[]int32`          |
| `smallint`       | `int16`            |
| `text`           | `string`           |
| `time`           | `time.Duration`    |
| `timestamp`      | `time.Time`        |
| `timeuuid`       | `gocql.UUID`       |
| `tinyint`        | `int8`             |
| `varchar`        | `string`           |
| `varint`         | `int64`            |

## 5. Configuration

In order to make shard-awareness work, token aware host selection policy has to be enabled.
Please make sure that the gocql configuration has `PoolConfig.HostSelectionPolicy` properly set like in the example below.

__When working with a Scylla cluster, `PoolConfig.NumConns` option has no effect - the driver opens one connection for each shard and completely ignores this option.__

```go
c := gocql.NewCluster(hosts...)

// Enable token aware host selection policy, if using multi-dc cluster set a local DC.
fallback := gocql.RoundRobinHostPolicy()
if localDC != "" {
	fallback = gocql.DCAwareRoundRobinPolicy(localDC)
}
c.PoolConfig.HostSelectionPolicy = gocql.TokenAwareHostPolicy(fallback)

// If using multi-dc cluster use the "local" consistency levels.
if localDC != "" {
	c.Consistency = gocql.LocalQuorum
}

// When working with a Scylla cluster the driver always opens one connection per shard, so `NumConns` is ignored.
// c.NumConns = 4
```

### 5.1 Shard-aware port

This version of gocql supports a more robust method of establishing connection for each shard by using _shard aware port_ for native transport.
It greatly reduces time and the number of connections needed to establish a connection per shard in some cases - ex. when many clients connect at once, or when there are non-shard-aware clients connected to the same cluster.

If you are using a custom Dialer and if your nodes expose the shard-aware port, it is highly recommended to update it so that it uses a specific source port when connecting.

* If you are using a custom `net.Dialer`, you can make your dialer honor the source port by wrapping it in a `gocql.ScyllaShardAwareDialer`:

  ```go
  oldDialer := net.Dialer{...}
  clusterConfig.Dialer := &gocql.ScyllaShardAwareDialer{oldDialer}
  ```

* If you are using a custom type implementing `gocql.Dialer`, you can get the source port by using the `gocql.ScyllaGetSourcePort` function.
  An example:

  ```go
  func (d *myDialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error) {
      sourcePort := gocql.ScyllaGetSourcePort(ctx)
      localAddr, err := net.ResolveTCPAddr(network, fmt.Sprintf(":%d", sourcePort))
      if err != nil {
          return nil, err
      }
	  d := &net.Dialer{LocalAddr: localAddr}
	  return d.DialContext(ctx, network, addr)
  }
  ```

  The source port might be already bound by another connection on your system.
  In such case, you should return an appropriate error so that the driver can retry with a different port suitable for the shard it tries to connect to.

  * If you are using `net.Dialer.DialContext`, this function will return an error in case the source port is unavailable, and you can just return that error from your custom `Dialer`.
  * Otherwise, if you detect that the source port is unavailable, you can either return `gocql.ErrScyllaSourcePortAlreadyInUse` or `syscall.EADDRINUSE`.

For this feature to work correctly, you need to make sure the following conditions are met:

* Your cluster nodes are configured to listen on the shard-aware port (`native_shard_aware_transport_port` option),
* Your cluster nodes are not behind a NAT which changes source ports,
* If you have a custom Dialer, it connects from the correct source port (see the guide above).

The feature is designed to gracefully fall back to the using the non-shard-aware port when it detects that some of the above conditions are not met.
The driver will print a warning about misconfigured address translation if it detects it.
Issues with shard-aware port not being reachable are not reported in non-debug mode, because there is no way to detect it without false positives.

If you suspect that this feature is causing you problems, you can completely disable it by setting the `ClusterConfig.DisableShardAwarePort` flag to true.

### 5.2 Client routes (PrivateLink)

Scylla Cloud exposes a `system.client_routes` table that maps hosts to PrivateLink endpoints.
When configured, the driver can resolve and connect to the per-host PrivateLink address instead of using the public host IP.

Use `WithClientRoutes` to enable it and pass the connection IDs you receive from Scylla Cloud:

```go
cluster := gocql.NewCluster("private-link.dns.name")
cluster.WithOptions(
	gocql.WithClientRoutes(
		gocql.WithEndpoints(
			gocql.ClientRoutesEndpoint{ConnectionID: "your-connection-id"},
		),
	),
)
```

If you also want to seed the cluster with PrivateLink hostnames, provide `ConnectionAddr` values in the endpoints list.

### 5.3 Iterator

Paging is a way to parse large result sets in smaller chunks.
The driver provides an iterator to simplify this process.

Use `Query.Iter()` to obtain iterator:

```go
iter := session.Query("SELECT id, value FROM my_table WHERE id > 100 AND id < 10000").Iter()
var results []int

var id, value int
for !iter.Scan(&id, &value) {
	if id%2 == 0 {
		results = append(results, value)
	}
}

if err := iter.Close(); err != nil {
    // handle error
}
```

In case of range and `ALLOW FILTERING` queries server can send empty responses for some pages.
That is why you should never consider empty response as the end of the result set.
Always check `iter.Scan()` result to know if there are more results, or `Iter.LastPage()` to know if the last page was reached.

### 5.3 Compression

To control network costs and traffic, you can enable compression.

Use `ClusterConfig.Compressor` to enable compression (either Snappy or LZ4):

```go
...
import (
    ...
    "github.com/gocql/gocql"
    "github.com/gocql/gocql/lz4"
    ...
)

config := gocql.NewCluster("10.0.12.83", "10.0.13.04", "10.0.14.12")
config.Compressor = &gocql.SnappyCompressor{}
//or LZ4
config.Compressor = &lz4.LZ4Compressor{}
...
```

## 6. Contributing

If you have any interest to be contributing in this GoCQL Fork, please read the [CONTRIBUTING.md](CONTRIBUTING.md) before initialize any Issue or Pull Request.


================================================
FILE: address_translators.go
================================================
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * Content before git sha 34fdeebefcbf183ed7f916f931aa0586fdaa1b40
 * Copyright (c) 2016, The Gocql authors,
 * provided under the BSD-3-Clause License.
 * See the NOTICE file distributed with this work for additional information.
 */

package gocql

import "net"

// AddressTranslator provides a way to translate node addresses (and ports) that are
// discovered or received as a node event. This can be useful in an ec2 environment,
// for instance, to translate public IPs to private IPs.
type AddressTranslator interface {
	// Translate will translate the provided address and/or port to another
	// address and/or port. If no translation is possible, Translate will return the
	// address and port provided to it.
	Translate(addr net.IP, port int) (net.IP, int)
}

type AddressTranslatorFunc func(addr net.IP, port int) (net.IP, int)

func (fn AddressTranslatorFunc) Translate(addr net.IP, port int) (net.IP, int) {
	return fn(addr, port)
}

// IdentityTranslator will do nothing but return what it was provided. It is essentially a no-op.
func IdentityTranslator() AddressTranslator {
	return AddressTranslatorFunc(func(addr net.IP, port int) (net.IP, int) {
		return addr, port
	})
}

type AddressTranslatorHostInfo interface {
	HostID() string
	Rack() string
	DataCenter() string
	BroadcastAddress() net.IP
	ListenAddress() net.IP
	RPCAddress() net.IP
	PreferredIP() net.IP
	Peer() net.IP
	UntranslatedConnectAddress() net.IP
	Port() int
	Partitioner() string
	ClusterName() string
	ScyllaShardAwarePort() uint16
	ScyllaShardAwarePortTLS() uint16
	ScyllaShardCount() int
}

// AddressTranslatorV2 provides a way to translate node addresses (and ports) that are
// discovered or received as a node event. This can be useful in an ec2 environment,
// for instance, to translate public IPs to private IPs.
type AddressTranslatorV2 interface {
	AddressTranslator
	TranslateHost(host AddressTranslatorHostInfo, addr AddressPort) (AddressPort, error)
}

type AddressTranslatorFuncV2 func(hostID string, addr AddressPort) AddressPort

func (fn AddressTranslatorFuncV2) Translate(addr net.IP, port int) (net.IP, int) {
	res := fn("", AddressPort{
		Address: addr,
		Port:    uint16(port),
	})
	return res.Address, int(res.Port)
}

func (fn AddressTranslatorFuncV2) TranslateHost(host AddressTranslatorHostInfo, addr AddressPort) (AddressPort, error) {
	return fn(host.HostID(), addr), nil
}

var _ AddressTranslatorV2 = AddressTranslatorFuncV2(nil)


================================================
FILE: address_translators_test.go
================================================
//go:build unit
// +build unit

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * Content before git sha 34fdeebefcbf183ed7f916f931aa0586fdaa1b40
 * Copyright (c) 2016, The Gocql authors,
 * provided under the BSD-3-Clause License.
 * See the NOTICE file distributed with this work for additional information.
 */

package gocql

import (
	"net"
	"testing"

	"github.com/gocql/gocql/internal/tests"
)

func TestIdentityAddressTranslator_NilAddrAndZeroPort(t *testing.T) {
	t.Parallel()

	var tr AddressTranslator = IdentityTranslator()
	hostIP := net.ParseIP("")
	if hostIP != nil {
		t.Errorf("expected host ip to be (nil) but was (%+v) instead", hostIP)
	}

	addr, port := tr.Translate(hostIP, 0)
	if addr != nil {
		t.Errorf("expected translated host to be (nil) but was (%+v) instead", addr)
	}
	tests.AssertEqual(t, "translated port", 0, port)
}

func TestIdentityAddressTranslator_HostProvided(t *testing.T) {
	t.Parallel()

	var tr AddressTranslator = IdentityTranslator()
	hostIP := net.ParseIP("10.1.2.3")
	if hostIP == nil {
		t.Error("expected host ip not to be (nil)")
	}

	addr, port := tr.Translate(hostIP, 9042)
	if !hostIP.Equal(addr) {
		t.Errorf("expected translated addr to be (%+v) but was (%+v) instead", hostIP, addr)
	}
	tests.AssertEqual(t, "translated port", 9042, port)
}

func TestTranslateHostAddresses_NoScyllaPorts(t *testing.T) {
	t.Parallel()

	translator := AddressTranslatorFunc(func(addr net.IP, port int) (net.IP, int) {
		return net.ParseIP("10.10.10.10"), 9142
	})
	host := HostInfoBuilder{
		ConnectAddress: net.ParseIP("10.0.0.1"),
		Port:           9042,
	}.Build()

	translated, err := translateHostAddresses(translator, &host, nil)

	tests.AssertNil(t, "should return no error", err)
	tests.AssertTrue(t, "translated CQL address", net.ParseIP("10.10.10.10").Equal(translated.CQL.Address))
	tests.AssertEqual(t, "translated CQL port", uint16(9142), translated.CQL.Port)
	tests.AssertTrue(t, "shard aware empty address", len(translated.ShardAware.Address) == 0)
	tests.AssertEqual(t, "shard aware empty port", uint16(0), translated.ShardAware.Port)
	tests.AssertTrue(t, "shard aware tls empty address", len(translated.ShardAwareTLS.Address) == 0)
	tests.AssertEqual(t, "shard aware tls empty port", uint16(0), translated.ShardAwareTLS.Port)
}

func TestTranslateHostAddresses_WithScyllaPorts(t *testing.T) {
	t.Parallel()

	translatedIP := net.ParseIP("192.0.2.10")
	translator := AddressTranslatorFuncV2(func(hostID string, addr AddressPort) AddressPort {
		if hostID != "a0000000-0000-0000-0000-000000000001" {
			t.Errorf("expected host id %q, got %q", "a0000000-0000-0000-0000-000000000001", hostID)
		}
		return AddressPort{
			Address: translatedIP,
			Port:    addr.Port + 1,
		}
	})
	host := HostInfoBuilder{
		ConnectAddress: net.ParseIP("10.0.0.1"),
		Port:           9042,
		HostId:         "a0000000-0000-0000-0000-000000000001",
	}.Build()
	host.setScyllaFeatures(ScyllaHostFeatures{
		shardAwarePort:    19042,
		shardAwarePortTLS: 19043,
	})

	translated, err := translateHostAddresses(translator, &host, nil)

	tests.AssertNil(t, "should return no error", err)
	tests.AssertTrue(t, "translated CQL address", translatedIP.Equal(translated.CQL.Address))
	tests.AssertEqual(t, "translated CQL port", uint16(9043), translated.CQL.Port)
	tests.AssertTrue(t, "translated shard aware address", translatedIP.Equal(translated.ShardAware.Address))
	tests.AssertEqual(t, "translated shard aware port", uint16(19043), translated.ShardAware.Port)
	tests.AssertTrue(t, "translated shard aware tls address", translatedIP.Equal(translated.ShardAwareTLS.Address))
	tests.AssertEqual(t, "translated shard aware tls port", uint16(19044), translated.ShardAwareTLS.Port)
}


================================================
FILE: batch_test.go
================================================
//go:build integration
// +build integration

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * Content before git sha 34fdeebefcbf183ed7f916f931aa0586fdaa1b40
 * Copyright (c) 2016, The Gocql authors,
 * provided under the BSD-3-Clause License.
 * See the NOTICE file distributed with this work for additional information.
 */

package gocql

import (
	"fmt"
	"testing"
	"time"
)

func TestBatch_Errors(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (id int primary key, val inet)`, table)); err != nil {
		t.Fatal(err)
	}

	b := session.Batch(LoggedBatch)
	b = b.Query(fmt.Sprintf("SELECT * FROM gocql_test.%s WHERE id=2 AND val=?", table), nil)
	if err := b.Exec(); err == nil {
		t.Fatal("expected to get error for invalid query in batch")
	}
}

func TestBatch_WithTimestamp(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (id int primary key, val text)`, table)); err != nil {
		t.Fatal(err)
	}

	micros := time.Now().UnixNano()/1e3 - 1000

	b := session.Batch(LoggedBatch)
	b.WithTimestamp(micros)
	b = b.Query(fmt.Sprintf("INSERT INTO gocql_test.%s (id, val) VALUES (?, ?)", table), 1, "val")
	b = b.Query(fmt.Sprintf("INSERT INTO gocql_test.%s (id, val) VALUES (?, ?)", table), 2, "val")

	if err := b.Exec(); err != nil {
		t.Fatal(err)
	}

	var storedTs int64
	if err := session.Query(fmt.Sprintf(`SELECT writetime(val) FROM gocql_test.%s WHERE id = ?`, table), 1).Scan(&storedTs); err != nil {
		t.Fatal(err)
	}

	if storedTs != micros {
		t.Errorf("got ts %d, expected %d", storedTs, micros)
	}
}


================================================
FILE: callreq_wait.go
================================================
//go:build !race

package gocql

func waitCallReqDone(call *callReq, where string) {
	call.done.Wait()
}


================================================
FILE: callreq_wait_race.go
================================================
//go:build race

package gocql

import (
	"fmt"
	"time"
)

func waitCallReqDone(call *callReq, where string) {
	done := make(chan struct{})
	go func() {
		call.done.Wait()
		close(done)
	}()

	timer := time.NewTimer(2 * time.Second)
	defer timer.Stop()

	select {
	case <-done:
	case <-timer.C:
		panic(fmt.Sprintf("gocql: timed out waiting for exec cleanup in %s (stream=%d)", where, call.streamID))
	}
}


================================================
FILE: cass1batch_test.go
================================================
//go:build integration
// +build integration

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * Content before git sha 34fdeebefcbf183ed7f916f931aa0586fdaa1b40
 * Copyright (c) 2016, The Gocql authors,
 * provided under the BSD-3-Clause License.
 * See the NOTICE file distributed with this work for additional information.
 */

package gocql

import (
	"fmt"
	"strings"
	"testing"
)

func TestProto1BatchInsert(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int primary key)", table)); err != nil {
		t.Fatal(err)
	}

	begin := "BEGIN BATCH"
	end := "APPLY BATCH"
	query := fmt.Sprintf("INSERT INTO %s (id) VALUES (?)", table)
	fullQuery := strings.Join([]string{begin, query, end}, "\n")
	args := []any{5}
	if err := session.Query(fullQuery, args...).Consistency(Quorum).Exec(); err != nil {
		t.Fatal(err)
	}
}

func TestShouldPrepareFunction(t *testing.T) {
	t.Parallel()

	var shouldPrepareTests = []struct {
		Stmt   string
		Result bool
	}{
		{`
      BEGIN BATCH
        INSERT INTO users (userID, password)
        VALUES ('smith', 'secret')
      APPLY BATCH
    ;
      `, true},
		{`INSERT INTO users (userID, password, name) VALUES ('user2', 'ch@ngem3b', 'second user')`, true},
		{`BEGIN COUNTER BATCH UPDATE stats SET views = views + 1 WHERE pageid = 1 APPLY BATCH`, true},
		{`delete name from users where userID = 'smith';`, true},
		{`  UPDATE users SET password = 'secret' WHERE userID = 'smith'   `, true},
		{`CREATE TABLE users (
        user_name varchar PRIMARY KEY,
        password varchar,
        gender varchar,
        session_token varchar,
        state varchar,
        birth_year bigint
      );`, false},
	}

	for _, test := range shouldPrepareTests {
		q := &Query{stmt: test.Stmt, routingInfo: &queryRoutingInfo{}}
		if got := q.shouldPrepare(); got != test.Result {
			t.Fatalf("%q: got %v, expected %v\n", test.Stmt, got, test.Result)
		}
	}
}


================================================
FILE: cassandra_test.go
================================================
//go:build integration
// +build integration

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * Content before git sha 34fdeebefcbf183ed7f916f931aa0586fdaa1b40
 * Copyright (c) 2016, The Gocql authors,
 * provided under the BSD-3-Clause License.
 * See the NOTICE file distributed with this work for additional information.
 */

package gocql

import (
	"bytes"
	"context"
	"errors"
	"fmt"
	"math"
	"math/big"
	"net"
	"reflect"
	"sort"
	"strconv"
	"strings"
	"testing"
	"time"
	"unicode"

	frm "github.com/gocql/gocql/internal/frame"
	"github.com/gocql/gocql/internal/tests"

	"github.com/stretchr/testify/require"
	"gopkg.in/inf.v0"
)

func TestEmptyHosts(t *testing.T) {
	t.Parallel()

	cluster := createCluster()
	cluster.Hosts = nil
	if session, err := cluster.CreateSession(); err == nil {
		session.Close()
		t.Error("expected err, got nil")
	}
}

func TestInvalidPeerEntry(t *testing.T) {
	t.Parallel()

	t.Skip("dont mutate system tables, rewrite this to test what we mean to test")
	session := createSession(t)

	// rack, release_version, schema_version, tokens are all null
	query := session.Query("INSERT into system.peers (peer, data_center, host_id, rpc_address) VALUES (?, ?, ?, ?)",
		"169.254.235.45",
		"datacenter1",
		"35c0ec48-5109-40fd-9281-9e9d4add2f1e",
		"169.254.235.45",
	)

	if err := query.Exec(); err != nil {
		t.Fatal(err)
	}

	session.Close()

	cluster := createCluster()
	cluster.PoolConfig.HostSelectionPolicy = TokenAwareHostPolicy(RoundRobinHostPolicy())
	session = createSessionFromCluster(cluster, t)
	defer func() {
		session.Query("DELETE from system.peers where peer = ?", "169.254.235.45").Exec()
		session.Close()
	}()

	// check we can perform a query
	iter := session.Query("select peer from system.peers").Iter()
	var peer string
	for iter.Scan(&peer) {
	}
	if err := iter.Close(); err != nil {
		t.Fatal(err)
	}
}

// TestUseStatementError checks to make sure the correct error is returned when the user tries to execute a use statement.
func TestUseStatementError(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	if err := session.Query("USE gocql_test").Exec(); err != nil {
		if err != ErrUseStmt {
			t.Fatalf("expected ErrUseStmt, got: %v", err)
		}
	} else {
		t.Fatal("expected err, got nil.")
	}
}

// TestInvalidKeyspace checks that an invalid keyspace will return promptly and without a flood of connections
func TestInvalidKeyspace(t *testing.T) {
	t.Parallel()

	cluster := createCluster()
	cluster.Keyspace = "invalidKeyspace"
	session, err := cluster.CreateSession()
	if err != nil {
		if err != ErrNoConnectionsStarted {
			t.Fatalf("Expected ErrNoConnections but got %v", err)
		}
	} else {
		session.Close() //Clean up the session
		t.Fatal("expected err, got nil.")
	}
}

func TestTracing(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (id int primary key)`, table)); err != nil {
		t.Fatal("create:", err)
	}

	buf := &bytes.Buffer{}
	trace := &TraceWriter{session: session, w: buf}
	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (id) VALUES (?)`, table), 42).Trace(trace).Exec(); err != nil {
		t.Fatal("insert:", err)
	} else if buf.Len() == 0 {
		t.Fatal("insert: failed to obtain any tracing")
	}
	trace.mu.Lock()
	buf.Reset()
	trace.mu.Unlock()

	var value int
	if err := session.Query(fmt.Sprintf(`SELECT id FROM %s WHERE id = ?`, table), 42).Trace(trace).Scan(&value); err != nil {
		t.Fatal("select:", err)
	} else if value != 42 {
		t.Fatalf("value: expected %d, got %d", 42, value)
	} else if buf.Len() == 0 {
		t.Fatal("select: failed to obtain any tracing")
	}

	// also works from session tracer
	session.SetTrace(trace)
	trace.mu.Lock()
	buf.Reset()
	trace.mu.Unlock()
	if err := session.Query(fmt.Sprintf(`SELECT id FROM %s WHERE id = ?`, table), 42).Scan(&value); err != nil {
		t.Fatal("select:", err)
	}
	if buf.Len() == 0 {
		t.Fatal("select: failed to obtain any tracing")
	}
}

func TestObserve(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (id int primary key)`, table)); err != nil {
		t.Fatal("create:", err)
	}

	var (
		observedErr      error
		observedKeyspace string
		observedStmt     string
	)

	const keyspace = "gocql_test"

	resetObserved := func() {
		observedErr = errors.New("placeholder only") // used to distinguish err=nil cases
		observedKeyspace = ""
		observedStmt = ""
	}

	observer := funcQueryObserver(func(ctx context.Context, o ObservedQuery) {
		observedKeyspace = o.Keyspace
		observedStmt = o.Statement
		observedErr = o.Err
	})

	// select before inserted, will error but the reporting is err=nil as the query is valid
	resetObserved()
	var value int
	if err := session.Query(fmt.Sprintf(`SELECT id FROM %s WHERE id = ?`, table), 43).Observer(observer).Scan(&value); err == nil {
		t.Fatal("select: expected error")
	} else if observedErr != nil {
		t.Fatalf("select: observed error expected nil, got %q", observedErr)
	} else if observedKeyspace != keyspace {
		t.Fatal("select: unexpected observed keyspace", observedKeyspace)
	} else if observedStmt != fmt.Sprintf(`SELECT id FROM %s WHERE id = ?`, table) {
		t.Fatal("select: unexpected observed stmt", observedStmt)
	}

	resetObserved()
	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (id) VALUES (?)`, table), 42).Observer(observer).Exec(); err != nil {
		t.Fatal("insert:", err)
	} else if observedErr != nil {
		t.Fatal("insert:", observedErr)
	} else if observedKeyspace != keyspace {
		t.Fatal("insert: unexpected observed keyspace", observedKeyspace)
	} else if observedStmt != fmt.Sprintf(`INSERT INTO %s (id) VALUES (?)`, table) {
		t.Fatal("insert: unexpected observed stmt", observedStmt)
	}

	resetObserved()
	value = 0
	if err := session.Query(fmt.Sprintf(`SELECT id FROM %s WHERE id = ?`, table), 42).Observer(observer).Scan(&value); err != nil {
		t.Fatal("select:", err)
	} else if value != 42 {
		t.Fatalf("value: expected %d, got %d", 42, value)
	} else if observedErr != nil {
		t.Fatal("select:", observedErr)
	} else if observedKeyspace != keyspace {
		t.Fatal("select: unexpected observed keyspace", observedKeyspace)
	} else if observedStmt != fmt.Sprintf(`SELECT id FROM %s WHERE id = ?`, table) {
		t.Fatal("select: unexpected observed stmt", observedStmt)
	}

	// also works from session observer
	resetObserved()
	oSession := createSession(t, func(config *ClusterConfig) { config.QueryObserver = observer })
	if err := oSession.Query(fmt.Sprintf(`SELECT id FROM %s WHERE id = ?`, table), 42).Scan(&value); err != nil {
		t.Fatal("select:", err)
	} else if observedErr != nil {
		t.Fatal("select:", err)
	} else if observedKeyspace != keyspace {
		t.Fatal("select: unexpected observed keyspace", observedKeyspace)
	} else if observedStmt != fmt.Sprintf(`SELECT id FROM %s WHERE id = ?`, table) {
		t.Fatal("select: unexpected observed stmt", observedStmt)
	}

	// reports errors when the query is poorly formed
	resetObserved()
	value = 0
	if err := session.Query(`SELECT id FROM unknown_table WHERE id = ?`, 42).Observer(observer).Scan(&value); err == nil {
		t.Fatal("select: expecting error")
	} else if observedErr == nil {
		t.Fatal("select: expecting observed error")
	} else if observedKeyspace != keyspace {
		t.Fatal("select: unexpected observed keyspace", observedKeyspace)
	} else if observedStmt != `SELECT id FROM unknown_table WHERE id = ?` {
		t.Fatal("select: unexpected observed stmt", observedStmt)
	}
}

func TestObserve_Pagination(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (id int, PRIMARY KEY (id))`, table)); err != nil {
		t.Fatal("create:", err)
	}

	var observedRows int

	resetObserved := func() {
		observedRows = -1
	}

	observer := funcQueryObserver(func(ctx context.Context, o ObservedQuery) {
		observedRows = o.Rows
	})

	// insert 100 entries, relevant for pagination
	for i := 0; i < 50; i++ {
		if err := session.Query(fmt.Sprintf(`INSERT INTO %s (id) VALUES (?)`, table), i).Exec(); err != nil {
			t.Fatal("insert:", err)
		}
	}

	resetObserved()

	// read the 100 entries in paginated entries of size 10. Expecting 5 observations, each with 10 rows
	scanner := session.Query(fmt.Sprintf(`SELECT id FROM %s LIMIT 100`, table)).
		Observer(observer).
		PageSize(10).
		Iter().Scanner()
	for i := 0; i < 50; i++ {
		if !scanner.Next() {
			t.Fatalf("next: should still be true: %d: %v", i, scanner.Err())
		}
		if i%10 == 0 {
			if observedRows != 10 {
				t.Fatalf("next: expecting a paginated query with 10 entries, got: %d (%d)", observedRows, i)
			}
		} else if observedRows != -1 {
			t.Fatalf("next: not expecting paginated query (-1 entries), got: %d", observedRows)
		}

		resetObserved()
	}

	if scanner.Next() {
		t.Fatal("next: no more entries where expected")
	}
}

func TestPaging(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int primary key)", table)); err != nil {
		t.Fatal("create table:", err)
	}
	for i := 0; i < 100; i++ {
		if err := session.Query(fmt.Sprintf("INSERT INTO %s (id) VALUES (?)", table), i).Exec(); err != nil {
			t.Fatal("insert:", err)
		}
	}

	iter := session.Query(fmt.Sprintf("SELECT id FROM %s", table)).PageSize(10).Iter()
	var id int
	count := 0
	for iter.Scan(&id) {
		count++
	}
	if err := iter.Close(); err != nil {
		t.Fatal("close:", err)
	}
	if count != 100 {
		t.Fatalf("expected %d, got %d", 100, count)
	}
}

func TestPagingWithAllowFiltering(t *testing.T) {
	t.Parallel()

	session := createSession(t)

	table := testTableName(t)

	t.Cleanup(func() {
		if err := session.Query(fmt.Sprintf("DROP TABLE gocql_test.%s", table)).Exec(); err != nil {
			t.Fatal("drop table:", err)
		}
		session.Close()
	})

	const (
		targetP1             = 50
		targetP2             = 50
		totalExpectedResults = 30
		pageSize             = 5
		deletedRageStart     = 10
		deletedRageEnd       = 20
		// Some record range is being deleted, to test tombstones appearance
		expectedCount = totalExpectedResults - (deletedRageEnd - deletedRageStart)
	)

	paginatedSelect := fmt.Sprintf("SELECT c1, f1 FROM gocql_test.%s WHERE p1 = %d AND p2 = %d AND f1 < %d ALLOW FILTERING;", table, targetP1, targetP2, totalExpectedResults)
	validateResult := func(t *testing.T, results []int) {
		if len(results) != expectedCount {
			t.Fatalf("expected %d got %d: %d", expectedCount, len(results), results)
		}

		sort.Ints(results)

		expect := make([]int, 0, expectedCount)
		for i := 0; i < totalExpectedResults; i++ {
			if i >= deletedRageStart && i < deletedRageEnd {
				continue
			}
			expect = append(expect, i)
		}

		if !reflect.DeepEqual(results, expect) {
			t.Fatalf("expected %v\ngot %v", expect, results)
		}
	}

	t.Run("Prepare", func(t *testing.T) {
		if err := createTable(session,
			fmt.Sprintf("CREATE TABLE gocql_test.%s (p1 int, p2 int, c1 int, f1 int, "+
				"PRIMARY KEY ((p1, p2), c1)) WITH CLUSTERING ORDER BY (c1 DESC)", table)); err != nil {
			t.Fatal("create table:", err)
		}

		// Insert extra records
		for i := 0; i < 100; i++ {
			if err := session.Query(fmt.Sprintf("INSERT INTO gocql_test.%s (p1,p2,c1,f1) VALUES (?,?,?,?)", table), i, i, i, i).Exec(); err != nil {
				t.Fatal("insert:", err)
			}
		}

		// Insert records to a target partition
		for i := 0; i < 100; i++ {
			if err := session.Query(fmt.Sprintf("INSERT INTO gocql_test.%s (p1,p2,c1,f1) VALUES (?,?,?,?)", table), targetP1, targetP2, i, i).Exec(); err != nil {
				t.Fatal("insert:", err)
			}
		}

		if err := session.Query(fmt.Sprintf("DELETE FROM gocql_test.%s WHERE p1 = ? AND p2 = ? AND c1 >= ? AND c1 < ?", table), targetP1, targetP2, deletedRageStart, deletedRageEnd).Exec(); err != nil {
			t.Fatal("insert:", err)
		}
	})

	t.Run("AutoPagination", func(t *testing.T) {
		for _, c := range []Consistency{One, Quorum} {
			t.Run(c.String(), func(t *testing.T) {
				iter := session.Query(paginatedSelect).Consistency(c).PageSize(pageSize).Iter()

				var c1, f1 int
				var results []int

				for iter.Scan(&c1, &f1) {
					if c1 != f1 {
						t.Fatalf("expected c1 and f1 values to be the same, but got c1=%d f1=%d", c1, f1)
					}
					results = append(results, f1)
				}
				if err := iter.Close(); err != nil {
					t.Fatal("select:", err.Error())
				}
				validateResult(t, results)
			})
		}
	})

	t.Run("ManualPagination", func(t *testing.T) {
		for _, c := range []Consistency{One, Quorum} {
			t.Run(c.String(), func(t *testing.T) {

				var c1, f1 int
				var results []int
				var currentPageState []byte

				qry := session.Query(paginatedSelect).Consistency(c).PageSize(pageSize)

				for {
					iter := qry.PageState(currentPageState).Iter()

					// Here we make sure that all iterator, but last one have some data in it
					if !iter.LastPage() && iter.NumRows() == 0 {
						t.Errorf("expected at least one row, but got 0")
					}
					for iter.Scan(&c1, &f1) {
						if c1 != f1 {
							t.Fatalf("expected c1 and f1 values to be the same, but got c1=%d f1=%d", c1, f1)
						}
						results = append(results, f1)
					}
					if err := iter.Close(); err != nil {
						t.Fatal("select:", err.Error())
					}
					if iter.LastPage() {
						break
					}
					newPageState := iter.PageState()
					if len(currentPageState) == len(newPageState) && bytes.Compare(newPageState, currentPageState) == 0 {
						t.Fatalf("page state did not change")
					}
					currentPageState = newPageState
				}

				validateResult(t, results)
			})
		}
	})

}

func TestPagingWithBind(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, val int, primary key(id,val))", table)); err != nil {
		t.Fatal("create table:", err)
	}
	for i := 0; i < 100; i++ {
		if err := session.Query(fmt.Sprintf("INSERT INTO %s (id,val) VALUES (?,?)", table), 1, i).Exec(); err != nil {
			t.Fatal("insert:", err)
		}
	}

	q := session.Query(fmt.Sprintf("SELECT val FROM %s WHERE id = ? AND val < ?", table), 1, 50).PageSize(10)
	iter := q.Iter()
	var id int
	count := 0
	for iter.Scan(&id) {
		count++
	}
	if err := iter.Close(); err != nil {
		t.Fatal("close:", err)
	}
	if count != 50 {
		t.Fatalf("expected %d, got %d", 50, count)
	}

	iter = q.Bind(1, 20).Iter()
	count = 0
	for iter.Scan(&id) {
		count++
	}
	if count != 20 {
		t.Fatalf("expected %d, got %d", 20, count)
	}
	if err := iter.Close(); err != nil {
		t.Fatal("close:", err)
	}
}

func TestCAS(t *testing.T) {
	t.Parallel()

	cluster := createCluster()
	cluster.SerialConsistency = LocalSerial
	session := createSessionFromClusterTabletsDisabled(cluster, t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE %s (
			title         varchar,
			revid   	  timeuuid,
			last_modified timestamp,
			PRIMARY KEY (title, revid)
		)`, table)); err != nil {
		t.Fatal("create:", err)
	}

	title, revid, modified := "baz", TimeUUID(), time.Now()
	var titleCAS string
	var revidCAS UUID
	var modifiedCAS time.Time

	if applied, err := session.Query(fmt.Sprintf(`INSERT INTO %s (title, revid, last_modified)
		VALUES (?, ?, ?) IF NOT EXISTS`,
		table), title, revid, modified).ScanCAS(&titleCAS, &revidCAS, &modifiedCAS); err != nil {
		t.Fatal("insert:", err)
	} else if !applied {
		t.Fatal("insert should have been applied")
	}

	if applied, err := session.Query(fmt.Sprintf(`INSERT INTO %s (title, revid, last_modified)
		VALUES (?, ?, ?) IF NOT EXISTS`,
		table), title, revid, modified).ScanCAS(&titleCAS, &revidCAS, &modifiedCAS); err != nil {
		t.Fatal("insert:", err)
	} else if applied {
		t.Fatal("insert should not have been applied")
	} else if title != titleCAS || revid != revidCAS {
		t.Fatalf("expected %s/%v/%v but got %s/%v/%v", title, revid, modified, titleCAS, revidCAS, modifiedCAS)
	}

	tenSecondsLater := modified.Add(10 * time.Second)

	if applied, err := session.Query(fmt.Sprintf(`DELETE FROM %s WHERE title = ? and revid = ? IF last_modified = ?`,
		table), title, revid, tenSecondsLater).ScanCAS(&modifiedCAS); err != nil {
		t.Fatal("delete:", err)
	} else if applied {
		t.Fatal("delete should have not been applied")
	}

	if modifiedCAS.Unix() != tenSecondsLater.Add(-10*time.Second).Unix() {
		t.Fatalf("Was expecting modified CAS to be %v; but was one second later", modifiedCAS.UTC())
	}

	if _, err := session.Query(fmt.Sprintf(`DELETE FROM %s WHERE title = ? and revid = ? IF last_modified = ?`,
		table), title, revid, tenSecondsLater).ScanCAS(); !strings.HasPrefix(err.Error(), "gocql: not enough columns to scan into") {
		t.Fatalf("delete: was expecting count mismatch error but got: %q", err.Error())
	}

	if applied, err := session.Query(fmt.Sprintf(`DELETE FROM %s WHERE title = ? and revid = ? IF last_modified = ?`,
		table), title, revid, modified).ScanCAS(&modifiedCAS); err != nil {
		t.Fatal("delete:", err)
	} else if !applied {
		t.Fatal("delete should have been applied")
	}

	if err := session.Query(fmt.Sprintf(`TRUNCATE %s`, table)).Exec(); err != nil {
		t.Fatal("truncate:", err)
	}

	successBatch := session.Batch(LoggedBatch)
	successBatch.Query(fmt.Sprintf("INSERT INTO %s (title, revid, last_modified) VALUES (?, ?, ?) IF NOT EXISTS", table), title, revid, modified)
	if applied, _, err := session.ExecuteBatchCAS(successBatch, &titleCAS, &revidCAS, &modifiedCAS); err != nil {
		t.Fatal("insert:", err)
	} else if !applied {
		t.Fatalf("insert should have been applied: title=%v revID=%v modified=%v", titleCAS, revidCAS, modifiedCAS)
	}

	successBatch = session.Batch(LoggedBatch)
	successBatch.Query(fmt.Sprintf("INSERT INTO %s (title, revid, last_modified) VALUES (?, ?, ?) IF NOT EXISTS", table), title+"_foo", revid, modified)
	casMap := make(map[string]any)
	if applied, _, err := session.MapExecuteBatchCAS(successBatch, casMap); err != nil {
		t.Fatal("insert:", err)
	} else if !applied {
		t.Fatal("insert should have been applied")
	}

	failBatch := session.Batch(LoggedBatch)
	failBatch.Query(fmt.Sprintf("INSERT INTO %s (title, revid, last_modified) VALUES (?, ?, ?) IF NOT EXISTS", table), title, revid, modified)
	if applied, _, err := session.ExecuteBatchCAS(successBatch, &titleCAS, &revidCAS, &modifiedCAS); err != nil {
		t.Fatal("insert:", err)
	} else if applied {
		t.Fatalf("insert should have not been applied: title=%v revID=%v modified=%v", titleCAS, revidCAS, modifiedCAS)
	}

	insertBatch := session.Batch(LoggedBatch)
	if *flagDistribution == "cassandra" && flagCassVersion.AtLeast(4, 1, 0) {
		insertBatch.Query(fmt.Sprintf("INSERT INTO %s (title, revid, last_modified) VALUES ('_foo', 2c3af400-73a4-11e5-9381-29463d90c3f0, toTimestamp(NOW()))", table))
		insertBatch.Query(fmt.Sprintf("INSERT INTO %s (title, revid, last_modified) VALUES ('_foo', 3e4ad2f1-73a4-11e5-9381-29463d90c3f0, toTimestamp(NOW()))", table))
	} else {
		insertBatch.Query(fmt.Sprintf("INSERT INTO %s (title, revid, last_modified) VALUES ('_foo', 2c3af400-73a4-11e5-9381-29463d90c3f0, DATEOF(NOW()))", table))
		insertBatch.Query(fmt.Sprintf("INSERT INTO %s (title, revid, last_modified) VALUES ('_foo', 3e4ad2f1-73a4-11e5-9381-29463d90c3f0, DATEOF(NOW()))", table))
	}
	if err := session.ExecuteBatch(insertBatch); err != nil {
		t.Fatal("insert:", err)
	}

	failBatch = session.Batch(LoggedBatch)
	if *flagDistribution == "cassandra" && flagCassVersion.AtLeast(4, 1, 0) {
		failBatch.Query(fmt.Sprintf("UPDATE %s SET last_modified = toTimestamp(NOW()) WHERE title='_foo' AND revid=2c3af400-73a4-11e5-9381-29463d90c3f0 IF last_modified=toTimestamp(NOW());", table))
		failBatch.Query(fmt.Sprintf("UPDATE %s SET last_modified = toTimestamp(NOW()) WHERE title='_foo' AND revid=3e4ad2f1-73a4-11e5-9381-29463d90c3f0 IF last_modified=toTimestamp(NOW());", table))
	} else {
		failBatch.Query(fmt.Sprintf("UPDATE %s SET last_modified = DATEOF(NOW()) WHERE title='_foo' AND revid=2c3af400-73a4-11e5-9381-29463d90c3f0 IF last_modified=DATEOF(NOW());", table))
		failBatch.Query(fmt.Sprintf("UPDATE %s SET last_modified = DATEOF(NOW()) WHERE title='_foo' AND revid=3e4ad2f1-73a4-11e5-9381-29463d90c3f0 IF last_modified=DATEOF(NOW());", table))
	}
	if applied, iter, err := session.ExecuteBatchCAS(failBatch, &titleCAS, &revidCAS, &modifiedCAS); err != nil {
		t.Fatal("insert:", err)
	} else if applied {
		t.Fatalf("insert should have not been applied: title=%v revID=%v modified=%v", titleCAS, revidCAS, modifiedCAS)
	} else {
		if scan := iter.Scan(&applied, &titleCAS, &revidCAS, &modifiedCAS); scan && applied {
			t.Fatalf("insert should have been applied: title=%v revID=%v modified=%v", titleCAS, revidCAS, modifiedCAS)
		} else if !scan {
			t.Fatal("should have scanned another row")
		}
		if err := iter.Close(); err != nil {
			t.Fatal("scan:", err)
		}
	}

	casMap = make(map[string]any)
	if applied, err := session.Query(fmt.Sprintf(`SELECT revid FROM %s WHERE title = ?`, table),
		title+"_foo").MapScanCAS(casMap); err != nil {
		t.Fatal("select:", err)
	} else if applied {
		t.Fatal("select shouldn't have returned applied")
	}

	if _, err := session.Query(fmt.Sprintf(`SELECT revid FROM %s WHERE title = ?`, table),
		title+"_foo").ScanCAS(&revidCAS); err == nil {
		t.Fatal("select: should have returned an error")
	}

	notCASBatch := session.Batch(LoggedBatch)
	notCASBatch.Query(fmt.Sprintf("INSERT INTO %s (title, revid, last_modified) VALUES (?, ?, ?)", table), title+"_baz", revid, modified)
	casMap = make(map[string]any)
	if _, _, err := session.MapExecuteBatchCAS(notCASBatch, casMap); err != ErrNotFound {
		t.Fatal("insert should have returned not found:", err)
	}

	notCASBatch = session.Batch(LoggedBatch)
	notCASBatch.Query(fmt.Sprintf("INSERT INTO %s (title, revid, last_modified) VALUES (?, ?, ?)", table), title+"_baz", revid, modified)
	casMap = make(map[string]any)
	if _, _, err := session.ExecuteBatchCAS(notCASBatch, &revidCAS); err != ErrNotFound {
		t.Fatal("insert should have returned not found:", err)
	}

	failBatch = session.Batch(LoggedBatch)
	failBatch.Query(fmt.Sprintf("UPDATE %s SET last_modified = TOTIMESTAMP(NOW()) WHERE title='_foo' AND revid=3e4ad2f1-73a4-11e5-9381-29463d90c3f0 IF last_modified = ?", table), modified)
	if _, _, err := session.ExecuteBatchCAS(failBatch, new(bool)); err == nil {
		t.Fatal("update should have errored")
	}
	// make sure MapScanCAS does not panic when MapScan fails
	casMap = make(map[string]any)
	casMap["last_modified"] = false
	if _, err := session.Query(fmt.Sprintf(`UPDATE %s SET last_modified = TOTIMESTAMP(NOW()) WHERE title='_foo' AND revid=3e4ad2f1-73a4-11e5-9381-29463d90c3f0 IF last_modified = ?`, table),
		modified).MapScanCAS(casMap); err == nil {
		t.Fatal("update should hvae errored", err)
	}

	// make sure MapExecuteBatchCAS does not panic when MapScan fails
	failBatch = session.Batch(LoggedBatch)
	failBatch.Query(fmt.Sprintf("UPDATE %s SET last_modified = TOTIMESTAMP(NOW()) WHERE title='_foo' AND revid=3e4ad2f1-73a4-11e5-9381-29463d90c3f0 IF last_modified = ?", table), modified)
	casMap = make(map[string]any)
	casMap["last_modified"] = false
	if _, _, err := session.MapExecuteBatchCAS(failBatch, casMap); err == nil {
		t.Fatal("update should have errored")
	}
}

func TestConsistencySerial(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	type testStruct struct {
		name               string
		id                 int
		consistency        Consistency
		expectedPanicValue string
	}

	testCases := []testStruct{
		{
			name:               "Any",
			consistency:        Any,
			expectedPanicValue: "Serial consistency can only be SERIAL or LOCAL_SERIAL got ANY",
		}, {
			name:               "One",
			consistency:        One,
			expectedPanicValue: "Serial consistency can only be SERIAL or LOCAL_SERIAL got ONE",
		}, {
			name:               "Two",
			consistency:        Two,
			expectedPanicValue: "Serial consistency can only be SERIAL or LOCAL_SERIAL got TWO",
		}, {
			name:               "Three",
			consistency:        Three,
			expectedPanicValue: "Serial consistency can only be SERIAL or LOCAL_SERIAL got THREE",
		}, {
			name:               "Quorum",
			consistency:        Quorum,
			expectedPanicValue: "Serial consistency can only be SERIAL or LOCAL_SERIAL got QUORUM",
		}, {
			name:               "LocalQuorum",
			consistency:        LocalQuorum,
			expectedPanicValue: "Serial consistency can only be SERIAL or LOCAL_SERIAL got LOCAL_QUORUM",
		}, {
			name:               "EachQuorum",
			consistency:        EachQuorum,
			expectedPanicValue: "Serial consistency can only be SERIAL or LOCAL_SERIAL got EACH_QUORUM",
		}, {
			name:               "Serial",
			id:                 8,
			consistency:        Serial,
			expectedPanicValue: "",
		}, {
			name:               "LocalSerial",
			id:                 9,
			consistency:        LocalSerial,
			expectedPanicValue: "",
		}, {
			name:               "LocalOne",
			consistency:        LocalOne,
			expectedPanicValue: "Serial consistency can only be SERIAL or LOCAL_SERIAL got LOCAL_ONE",
		},
	}

	err := session.Query(fmt.Sprintf("CREATE TABLE IF NOT EXISTS gocql_test.%s (id int PRIMARY KEY)", table)).Exec()
	if err != nil {
		t.Fatalf("can't create table:%v", err)
	}

	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			if tc.expectedPanicValue == "" {
				err = session.Query(fmt.Sprintf("INSERT INTO gocql_test.%s (id) VALUES (?)", table), tc.id).SerialConsistency(tc.consistency).Exec()
				if err != nil {
					t.Fatal(err)
				}

				var receivedID int
				err = session.Query(fmt.Sprintf("SELECT * FROM gocql_test.%s WHERE id=?", table), tc.id).Scan(&receivedID)
				if err != nil {
					t.Fatal(err)
				}

				require.Equal(t, tc.id, receivedID)
			} else {
				require.PanicsWithValue(t, tc.expectedPanicValue, func() {
					session.Query(fmt.Sprintf("INSERT INTO gocql_test.%s (id) VALUES (?)", table), tc.id).SerialConsistency(tc.consistency)
				})
			}
		})
	}
}

func TestDurationType(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	if session.cfg.ProtoVersion < protoVersion5 {
		t.Skip("Duration type is not supported. Please use protocol version >= 4 and cassandra version >= 3.11")
	}

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (
		k int primary key, v duration
	)`, table)); err != nil {
		t.Fatal("create:", err)
	}

	durations := []Duration{
		Duration{
			Months:      250,
			Days:        500,
			Nanoseconds: 300010001,
		},
		Duration{
			Months:      -250,
			Days:        -500,
			Nanoseconds: -300010001,
		},
		Duration{
			Months:      0,
			Days:        128,
			Nanoseconds: 127,
		},
		Duration{
			Months:      0x7FFFFFFF,
			Days:        0x7FFFFFFF,
			Nanoseconds: 0x7FFFFFFFFFFFFFFF,
		},
	}
	for _, durationSend := range durations {
		if err := session.Query(fmt.Sprintf(`INSERT INTO gocql_test.%s (k, v) VALUES (1, ?)`, table), durationSend).Exec(); err != nil {
			t.Fatal(err)
		}

		var id int
		var duration Duration
		if err := session.Query(fmt.Sprintf(`SELECT k, v FROM gocql_test.%s`, table)).Scan(&id, &duration); err != nil {
			t.Fatal(err)
		}
		if duration.Months != durationSend.Months || duration.Days != durationSend.Days || duration.Nanoseconds != durationSend.Nanoseconds {
			t.Fatalf("Unexpeted value returned, expected=%v, received=%v", durationSend, duration)
		}
	}
}

func TestMapScanCAS(t *testing.T) {
	t.Parallel()

	session := createSessionFromClusterTabletsDisabled(createCluster(), t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE %s (
			title         varchar,
			revid   	  timeuuid,
			last_modified timestamp,
			deleted boolean,
			PRIMARY KEY (title, revid)
		)`, table)); err != nil {
		t.Fatal("create:", err)
	}

	title, revid, modified, deleted := "baz", TimeUUID(), time.Now(), false
	mapCAS := map[string]any{}

	if applied, err := session.Query(fmt.Sprintf(`INSERT INTO %s (title, revid, last_modified, deleted)
		VALUES (?, ?, ?, ?) IF NOT EXISTS`, table),
		title, revid, modified, deleted).MapScanCAS(mapCAS); err != nil {
		t.Fatal("insert:", err)
	} else if !applied {
		t.Fatalf("insert should have been applied: title=%v revID=%v modified=%v", title, revid, modified)
	}

	mapCAS = map[string]any{}
	if applied, err := session.Query(fmt.Sprintf(`INSERT INTO %s (title, revid, last_modified, deleted)
		VALUES (?, ?, ?, ?) IF NOT EXISTS`, table),
		title, revid, modified, deleted).MapScanCAS(mapCAS); err != nil {
		t.Fatal("insert:", err)
	} else if applied {
		t.Fatalf("insert should have been applied: title=%v revID=%v modified=%v", title, revid, modified)
	} else if title != mapCAS["title"] || revid != mapCAS["revid"] || deleted != mapCAS["deleted"] {
		t.Fatalf("expected %s/%v/%v/%v but got %s/%v/%v%v", title, revid, modified, false, mapCAS["title"], mapCAS["revid"], mapCAS["last_modified"], mapCAS["deleted"])
	}

}

func TestBatch(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (id int primary key)`, table)); err != nil {
		t.Fatal("create table:", err)
	}

	batch := session.Batch(LoggedBatch)
	for i := 0; i < 100; i++ {
		batch.Query(fmt.Sprintf(`INSERT INTO %s (id) VALUES (?)`, table), i)
	}

	if err := session.ExecuteBatch(batch); err != nil {
		t.Fatal("execute batch:", err)
	}

	count := 0
	if err := session.Query(fmt.Sprintf(`SELECT COUNT(*) FROM %s`, table)).Scan(&count); err != nil {
		t.Fatal("select count:", err)
	} else if count != 100 {
		t.Fatalf("count: expected %d, got %d\n", 100, count)
	}
}

func TestUnpreparedBatch(t *testing.T) {
	t.Parallel()

	t.Skip("FLAKE skipping")
	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (id int primary key, c counter)`, table)); err != nil {
		t.Fatal("create table:", err)
	}

	batch := session.Batch(UnloggedBatch)

	for i := 0; i < 100; i++ {
		batch.Query(fmt.Sprintf(`UPDATE %s SET c = c + 1 WHERE id = 1`, table))
	}

	if err := session.ExecuteBatch(batch); err != nil {
		t.Fatal("execute batch:", err)
	}

	count := 0
	if err := session.Query(fmt.Sprintf(`SELECT COUNT(*) FROM %s`, table)).Scan(&count); err != nil {
		t.Fatal("select count:", err)
	} else if count != 1 {
		t.Fatalf("count: expected %d, got %d\n", 100, count)
	}

	if err := session.Query(fmt.Sprintf(`SELECT c FROM %s`, table)).Scan(&count); err != nil {
		t.Fatal("select count:", err)
	} else if count != 100 {
		t.Fatalf("count: expected %d, got %d\n", 100, count)
	}
}

// TestBatchLimit tests gocql to make sure batch operations larger than the maximum
// statement limit are not submitted to a cassandra node.
func TestBatchLimit(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (id int primary key)`, table)); err != nil {
		t.Fatal("create table:", err)
	}

	batch := session.Batch(LoggedBatch)
	for i := 0; i < 65537; i++ {
		batch.Query(fmt.Sprintf(`INSERT INTO %s (id) VALUES (?)`, table), i)
	}
	if err := session.ExecuteBatch(batch); err != ErrTooManyStmts {
		t.Fatal("gocql attempted to execute a batch larger than the support limit of statements.")
	}

}

func TestWhereIn(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (id int, cluster int, primary key (id,cluster))`, table)); err != nil {
		t.Fatal("create table:", err)
	}

	if err := session.Query(fmt.Sprintf("INSERT INTO %s (id, cluster) VALUES (?,?)", table), 100, 200).Exec(); err != nil {
		t.Fatal("insert:", err)
	}

	iter := session.Query(fmt.Sprintf("SELECT * FROM %s WHERE id = ? AND cluster IN (?)", table), 100, 200).Iter()
	var id, cluster int
	count := 0
	for iter.Scan(&id, &cluster) {
		count++
	}

	if id != 100 || cluster != 200 {
		t.Fatalf("Was expecting id and cluster to be (100,200) but were (%d,%d)", id, cluster)
	}
}

// TestTooManyQueryArgs tests to make sure the library correctly handles the application level bug
// whereby too many query arguments are passed to a query
func TestTooManyQueryArgs(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (id int primary key, value int)`, table)); err != nil {
		t.Fatal("create table:", err)
	}

	_, err := session.Query(fmt.Sprintf(`SELECT * FROM %s WHERE id = ?`, table), 1, 2).Iter().SliceMap()

	if err == nil {
		t.Fatal("'SELECT * FROM <table> WHERE id = ?, 1, 2' should return an error")
	}

	batch := session.Batch(UnloggedBatch)
	batch.Query(fmt.Sprintf("INSERT INTO %s (id, value) VALUES (?, ?)", table), 1, 2, 3)
	err = session.ExecuteBatch(batch)

	if err == nil {
		t.Fatal("'`INSERT INTO too_many_query_args (id, value) VALUES (?, ?)`, 1, 2, 3' should return an error")
	}

	// TODO: should indicate via an error code that it is an invalid arg?

}

// TestNotEnoughQueryArgs tests to make sure the library correctly handles the application level bug
// whereby not enough query arguments are passed to a query
func TestNotEnoughQueryArgs(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (id int, cluster int, value int, primary key (id, cluster))`, table)); err != nil {
		t.Fatal("create table:", err)
	}

	_, err := session.Query(fmt.Sprintf(`SELECT * FROM %s WHERE id = ? and cluster = ?`, table), 1).Iter().SliceMap()

	if err == nil {
		t.Fatal("'SELECT * FROM <table> WHERE id = ? and cluster = ?, 1' should return an error")
	}

	batch := session.Batch(UnloggedBatch)
	batch.Query(fmt.Sprintf("INSERT INTO %s (id, cluster, value) VALUES (?, ?, ?)", table), 1, 2)
	err = session.ExecuteBatch(batch)

	if err == nil {
		t.Fatal("'`INSERT INTO not_enough_query_args (id, cluster, value) VALUES (?, ?, ?)`, 1, 2' should return an error")
	}
}

// TestCreateSessionTimeout tests to make sure the CreateSession function timeouts out correctly
// and prevents an infinite loop of connection retries.
func TestCreateSessionTimeout(t *testing.T) {
	t.Parallel()

	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	go func() {
		select {
		case <-time.After(2 * time.Second):
			t.Error("no startup timeout")
		case <-ctx.Done():
		}
	}()

	cluster := createCluster()
	cluster.Hosts = []string{"127.0.0.1:1"}
	session, err := cluster.CreateSession()
	if err == nil {
		session.Close()
		t.Fatal("expected ErrNoConnectionsStarted, but no error was returned.")
	}
}

// TestReconnection verifies that a node marked down is eventually reconnected.
// WARNING: This test must NOT use t.Parallel(). It calls session.handleNodeDown()
// which mutates shared HostInfo state visible to all concurrent sessions.
//
//nolint:paralleltest // mutates shared HostInfo state via handleNodeDown()
func TestReconnection(t *testing.T) {
	cluster := createCluster()
	cluster.ReconnectInterval = 1 * time.Second
	session := createSessionFromCluster(cluster, t)
	defer session.Close()

	h := session.hostSource.getHostsList()[0]
	session.handleNodeDown(h.ConnectAddress(), h.Port())

	if h.State() != NodeDown {
		t.Fatal("Host should be NodeDown but not.")
	}

	time.Sleep(cluster.ReconnectInterval + h.Version().nodeUpDelay() + 1*time.Second)

	if h.State() != NodeUp {
		t.Fatal("Host should be NodeUp but not. Failed to reconnect.")
	}
}

type FullName struct {
	FirstName string
	LastName  string
}

func (n FullName) MarshalCQL(info TypeInfo) ([]byte, error) {
	return []byte(n.FirstName + " " + n.LastName), nil
}

func (n *FullName) UnmarshalCQL(info TypeInfo, data []byte) error {
	t := strings.SplitN(string(data), " ", 2)
	n.FirstName, n.LastName = t[0], t[1]
	return nil
}

func TestMapScanWithRefMap(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)
	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (
			testtext       text PRIMARY KEY,
			testfullname   text,
			testint        int,
		)`, table)); err != nil {
		t.Fatal("create table:", err)
	}
	m := make(map[string]any)
	m["testtext"] = "testtext"
	m["testfullname"] = FullName{FirstName: "John", LastName: "Doe"}
	m["testint"] = 100

	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (testtext, testfullname, testint) values (?,?,?)`, table),
		m["testtext"], m["testfullname"], m["testint"]).Exec(); err != nil {
		t.Fatal("insert:", err)
	}

	var testText string
	var testFullName FullName
	ret := map[string]any{
		"testtext":     &testText,
		"testfullname": &testFullName,
		// testint is not set here.
	}
	iter := session.Query(fmt.Sprintf(`SELECT * FROM %s`, table)).Iter()
	if ok := iter.MapScan(ret); !ok {
		t.Fatal("select:", iter.Close())
	} else {
		if ret["testtext"] != "testtext" {
			t.Fatal("returned testtext did not match")
		}
		f := ret["testfullname"].(FullName)
		if f.FirstName != "John" || f.LastName != "Doe" {
			t.Fatal("returned testfullname did not match")
		}
		if ret["testint"] != 100 {
			t.Fatal("returned testinit did not match")
		}
	}
	if testText != "testtext" {
		t.Fatal("returned testtext did not match")
	}
	if testFullName.FirstName != "John" || testFullName.LastName != "Doe" {
		t.Fatal("returned testfullname did not match")
	}

	// using MapScan to read a nil int value
	intp := new(int64)
	ret = map[string]any{
		"testint": &intp,
	}
	if err := session.Query(fmt.Sprintf("INSERT INTO %s(testtext, testint) VALUES(?, ?)", table), "null-int", nil).Exec(); err != nil {
		t.Fatal(err)
	}
	err := session.Query(fmt.Sprintf(`SELECT testint FROM %s WHERE testtext = ?`, table), "null-int").MapScan(ret)
	if err != nil {
		t.Fatal(err)
	} else if v := ret["testint"].(*int64); v != nil {
		t.Fatalf("testint should be nil got %+#v", v)
	}

}

func TestMapScan(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)
	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (
			fullname       text PRIMARY KEY,
			age            int,
			address        inet,
			data           blob,
		)`, table)); err != nil {
		t.Fatal("create table:", err)
	}

	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (fullname, age, address) values (?,?,?)`, table),
		"Grace Hopper", 31, net.ParseIP("10.0.0.1")).Exec(); err != nil {
		t.Fatal("insert:", err)
	}
	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (fullname, age, address, data) values (?,?,?,?)`, table),
		"Ada Lovelace", 30, net.ParseIP("10.0.0.2"), []byte(`{"foo": "bar"}`)).Exec(); err != nil {
		t.Fatal("insert:", err)
	}

	iter := session.Query(fmt.Sprintf(`SELECT * FROM %s`, table)).Iter()

	// First iteration
	row := make(map[string]any)
	if !iter.MapScan(row) {
		t.Fatal("select:", iter.Close())
	}
	tests.AssertEqual(t, "fullname", "Ada Lovelace", row["fullname"])
	tests.AssertEqual(t, "age", 30, row["age"])
	tests.AssertEqual(t, "address", "10.0.0.2", row["address"])
	tests.AssertDeepEqual(t, "data", []byte(`{"foo": "bar"}`), row["data"])

	// Second iteration using a new map
	row = make(map[string]any)
	if !iter.MapScan(row) {
		t.Fatal("select:", iter.Close())
	}
	tests.AssertEqual(t, "fullname", "Grace Hopper", row["fullname"])
	tests.AssertEqual(t, "age", 31, row["age"])
	tests.AssertEqual(t, "address", "10.0.0.1", row["address"])
	tests.AssertDeepEqual(t, "data", []byte(nil), row["data"])
}

func TestSliceMap(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)
	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (
			testuuid       timeuuid PRIMARY KEY,
			testtimestamp  timestamp,
			testvarchar    varchar,
			testbigint     bigint,
			testblob       blob,
			testbool       boolean,
			testfloat      float,
			testdouble     double,
			testint        int,
			testdecimal    decimal,
			testlist       list<text>,
			testset        set<int>,
			testmap        map<varchar, varchar>,
			testvarint     varint,
			testinet			 inet
		)`, table)); err != nil {
		t.Fatal("create table:", err)
	}
	m := make(map[string]any)

	bigInt := new(big.Int)
	if _, ok := bigInt.SetString("830169365738487321165427203929228", 10); !ok {
		t.Fatal("Failed setting bigint by string")
	}

	m["testuuid"] = TimeUUID()
	m["testvarchar"] = "Test VarChar"
	m["testbigint"] = time.Now().Unix()
	m["testtimestamp"] = time.Now().Truncate(time.Millisecond).UTC()
	m["testblob"] = []byte("test blob")
	m["testbool"] = true
	m["testfloat"] = float32(4.564)
	m["testdouble"] = float64(4.815162342)
	m["testint"] = 2343
	m["testdecimal"] = inf.NewDec(100, 0)
	m["testlist"] = []string{"quux", "foo", "bar", "baz", "quux"}
	m["testset"] = []int{1, 2, 3, 4, 5, 6, 7, 8, 9}
	m["testmap"] = map[string]string{"field1": "val1", "field2": "val2", "field3": "val3"}
	m["testvarint"] = bigInt
	m["testinet"] = "213.212.2.19"
	sliceMap := []map[string]any{m}
	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (testuuid, testtimestamp, testvarchar, testbigint, testblob, testbool, testfloat, testdouble, testint, testdecimal, testlist, testset, testmap, testvarint, testinet) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, table),
		m["testuuid"], m["testtimestamp"], m["testvarchar"], m["testbigint"], m["testblob"], m["testbool"], m["testfloat"], m["testdouble"], m["testint"], m["testdecimal"], m["testlist"], m["testset"], m["testmap"], m["testvarint"], m["testinet"]).Exec(); err != nil {
		t.Fatal("insert:", err)
	}
	if returned, retErr := session.Query(fmt.Sprintf(`SELECT * FROM %s`, table)).Iter().SliceMap(); retErr != nil {
		t.Fatal("select:", retErr)
	} else {
		matchSliceMap(t, sliceMap, returned[0])
	}

	// Test for Iter.MapScan()
	{
		testMap := make(map[string]any)
		if !session.Query(fmt.Sprintf(`SELECT * FROM %s`, table)).Iter().MapScan(testMap) {
			t.Fatal("MapScan failed to work with one row")
		}
		matchSliceMap(t, sliceMap, testMap)
	}

	// Test for Query.MapScan()
	{
		testMap := make(map[string]any)
		if session.Query(fmt.Sprintf(`SELECT * FROM %s`, table)).MapScan(testMap) != nil {
			t.Fatal("MapScan failed to work with one row")
		}
		matchSliceMap(t, sliceMap, testMap)
	}
}
func matchSliceMap(t *testing.T, sliceMap []map[string]any, testMap map[string]any) {
	if sliceMap[0]["testuuid"] != testMap["testuuid"] {
		t.Fatal("returned testuuid did not match")
	}
	if sliceMap[0]["testtimestamp"] != testMap["testtimestamp"] {
		t.Fatal("returned testtimestamp did not match")
	}
	if sliceMap[0]["testvarchar"] != testMap["testvarchar"] {
		t.Fatal("returned testvarchar did not match")
	}
	if sliceMap[0]["testbigint"] != testMap["testbigint"] {
		t.Fatal("returned testbigint did not match")
	}
	if !reflect.DeepEqual(sliceMap[0]["testblob"], testMap["testblob"]) {
		t.Fatal("returned testblob did not match")
	}
	if sliceMap[0]["testbool"] != testMap["testbool"] {
		t.Fatal("returned testbool did not match")
	}
	if sliceMap[0]["testfloat"] != testMap["testfloat"] {
		t.Fatal("returned testfloat did not match")
	}
	if sliceMap[0]["testdouble"] != testMap["testdouble"] {
		t.Fatal("returned testdouble did not match")
	}
	if sliceMap[0]["testinet"] != testMap["testinet"] {
		t.Fatal("returned testinet did not match")
	}

	expectedDecimal := sliceMap[0]["testdecimal"].(*inf.Dec)
	returnedDecimal := testMap["testdecimal"].(*inf.Dec)

	if expectedDecimal.Cmp(returnedDecimal) != 0 {
		t.Fatal("returned testdecimal did not match")
	}

	if !reflect.DeepEqual(sliceMap[0]["testlist"], testMap["testlist"]) {
		t.Fatal("returned testlist did not match")
	}
	if !reflect.DeepEqual(sliceMap[0]["testset"], testMap["testset"]) {
		t.Fatal("returned testset did not match")
	}
	if !reflect.DeepEqual(sliceMap[0]["testmap"], testMap["testmap"]) {
		t.Fatal("returned testmap did not match")
	}
	if sliceMap[0]["testint"] != testMap["testint"] {
		t.Fatal("returned testint did not match")
	}
}

type MyRetryPolicy struct {
}

func (*MyRetryPolicy) Attempt(q RetryableQuery) bool {
	if q.Attempts() > 5 {
		return false
	}
	return true
}

func (*MyRetryPolicy) GetRetryType(err error) RetryType {
	var executedErr *QueryError
	if errors.As(err, &executedErr) && !executedErr.IsIdempotent() {
		return Ignore
	}
	return Retry
}

func Test_RetryPolicyIdempotence(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	testCases := []struct {
		name                  string
		idempotency           bool
		expectedNumberOfTries int
	}{
		{
			name:                  "with retry",
			idempotency:           true,
			expectedNumberOfTries: 6,
		},
		{
			name:                  "without retry",
			idempotency:           false,
			expectedNumberOfTries: 1,
		},
	}

	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			q := session.Query("INSERT INTO  gocql_test.not_existing_table(event_id, time, args) VALUES (?,?,?)", 4, UUIDFromTime(time.Now()), "test")

			q.Idempotent(tc.idempotency)
			q.RetryPolicy(&MyRetryPolicy{})
			q.Consistency(All)

			_ = q.Exec()
			require.Equal(t, tc.expectedNumberOfTries, q.Attempts())
		})
	}
}

func TestSmallInt(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (
			testsmallint  smallint PRIMARY KEY,
		)`, table)); err != nil {
		t.Fatal("create table:", err)
	}
	m := make(map[string]any)
	m["testsmallint"] = int16(2)
	sliceMap := []map[string]any{m}
	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (testsmallint) VALUES (?)`, table),
		m["testsmallint"]).Exec(); err != nil {
		t.Fatal("insert:", err)
	}
	if returned, retErr := session.Query(fmt.Sprintf(`SELECT * FROM %s`, table)).Iter().SliceMap(); retErr != nil {
		t.Fatal("select:", retErr)
	} else {
		if sliceMap[0]["testsmallint"] != returned[0]["testsmallint"] {
			t.Fatal("returned testsmallint did not match")
		}
	}
}

func TestScanWithNilArguments(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (
			foo   varchar,
			bar   int,
			PRIMARY KEY (foo, bar)
	)`, table)); err != nil {
		t.Fatal("create:", err)
	}
	for i := 1; i <= 20; i++ {
		if err := session.Query(fmt.Sprintf("INSERT INTO %s (foo, bar) VALUES (?, ?)", table),
			"squares", i*i).Exec(); err != nil {
			t.Fatal("insert:", err)
		}
	}

	iter := session.Query(fmt.Sprintf("SELECT * FROM %s WHERE foo = ?", table), "squares").Iter()
	var n int
	count := 0
	for iter.Scan(nil, &n) {
		count += n
	}
	if err := iter.Close(); err != nil {
		t.Fatal("close:", err)
	}
	if count != 2870 {
		t.Fatalf("expected %d, got %d", 2870, count)
	}
}

func TestScanCASWithNilArguments(t *testing.T) {
	t.Parallel()

	session := createSessionFromClusterTabletsDisabled(createCluster(), t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE %s (
		foo   varchar,
		bar   varchar,
		PRIMARY KEY (foo, bar)
	)`, table)); err != nil {
		t.Fatal("create:", err)
	}

	foo := "baz"
	var cas string

	if applied, err := session.Query(fmt.Sprintf(`INSERT INTO %s (foo, bar)
		VALUES (?, ?) IF NOT EXISTS`, table),
		foo, foo).ScanCAS(nil, nil); err != nil {
		t.Fatal("insert:", err)
	} else if !applied {
		t.Fatal("insert should have been applied")
	}

	if applied, err := session.Query(fmt.Sprintf(`INSERT INTO %s (foo, bar)
		VALUES (?, ?) IF NOT EXISTS`, table),
		foo, foo).ScanCAS(&cas, nil); err != nil {
		t.Fatal("insert:", err)
	} else if applied {
		t.Fatal("insert should not have been applied")
	} else if foo != cas {
		t.Fatalf("expected %v but got %v", foo, cas)
	}

	if applied, err := session.Query(fmt.Sprintf(`INSERT INTO %s (foo, bar)
		VALUES (?, ?) IF NOT EXISTS`, table),
		foo, foo).ScanCAS(nil, &cas); err != nil {
		t.Fatal("insert:", err)
	} else if applied {
		t.Fatal("insert should not have been applied")
	} else if foo != cas {
		t.Fatalf("expected %v but got %v", foo, cas)
	}
}

func TestRebindQueryInfo(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, value text, PRIMARY KEY (id))", table)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}

	if err := session.Query(fmt.Sprintf("INSERT INTO %s (id, value) VALUES (?, ?)", table), 23, "quux").Exec(); err != nil {
		t.Fatalf("insert into rebind_query failed, err '%v'", err)
	}

	if err := session.Query(fmt.Sprintf("INSERT INTO %s (id, value) VALUES (?, ?)", table), 24, "w00t").Exec(); err != nil {
		t.Fatalf("insert into rebind_query failed, err '%v'", err)
	}

	q := session.Query(fmt.Sprintf("SELECT value FROM %s WHERE ID = ?", table))
	q.Bind(23)

	iter := q.Iter()
	var value string
	for iter.Scan(&value) {
	}

	if value != "quux" {
		t.Fatalf("expected %v but got %v", "quux", value)
	}

	q.Bind(24)
	iter = q.Iter()

	for iter.Scan(&value) {
	}

	if value != "w00t" {
		t.Fatalf("expected %v but got %v", "w00t", value)
	}
}

// TestStaticQueryInfo makes sure that the application can manually bind query parameters using the simplest possible static binding strategy
func TestStaticQueryInfo(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, value text, PRIMARY KEY (id))", table)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}

	if err := session.Query(fmt.Sprintf("INSERT INTO %s (id, value) VALUES (?, ?)", table), 113, "foo").Exec(); err != nil {
		t.Fatalf("insert into static_query_info failed, err '%v'", err)
	}

	autobinder := func(q *QueryInfo) ([]any, error) {
		values := make([]any, 1)
		values[0] = 113
		return values, nil
	}

	qry := session.Bind(fmt.Sprintf("SELECT id, value FROM %s WHERE id = ?", table), autobinder)

	if err := qry.Exec(); err != nil {
		t.Fatalf("expose query info failed, error '%v'", err)
	}

	iter := qry.Iter()

	var id int
	var value string

	iter.Scan(&id, &value)

	if err := iter.Close(); err != nil {
		t.Fatalf("query with exposed info failed, err '%v'", err)
	}

	if value != "foo" {
		t.Fatalf("Expected value %s, but got %s", "foo", value)
	}

}

type ClusteredKeyValue struct {
	Id      int
	Cluster int
	Value   string
}

func (kv *ClusteredKeyValue) Bind(q *QueryInfo) ([]any, error) {
	values := make([]any, len(q.Args))

	for i, info := range q.Args {
		fieldName := upcaseInitial(info.Name)
		value := reflect.ValueOf(kv)
		field := reflect.Indirect(value).FieldByName(fieldName)
		values[i] = field.Addr().Interface()
	}

	return values, nil
}

func upcaseInitial(str string) string {
	for i, v := range str {
		return string(unicode.ToUpper(v)) + str[i+1:]
	}
	return ""
}

// TestBoundQueryInfo makes sure that the application can manually bind query parameters using the query meta data supplied at runtime
func TestBoundQueryInfo(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, cluster int, value text, PRIMARY KEY (id, cluster))", table)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}

	write := &ClusteredKeyValue{Id: 200, Cluster: 300, Value: "baz"}

	insert := session.Bind(fmt.Sprintf("INSERT INTO %s (id, cluster, value) VALUES (?, ?,?)", table), write.Bind)

	if err := insert.Exec(); err != nil {
		t.Fatalf("insert into clustered_query_info failed, err '%v'", err)
	}

	read := &ClusteredKeyValue{Id: 200, Cluster: 300}

	qry := session.Bind(fmt.Sprintf("SELECT id, cluster, value FROM %s WHERE id = ? and cluster = ?", table), read.Bind)

	iter := qry.Iter()

	var id, cluster int
	var value string

	iter.Scan(&id, &cluster, &value)

	if err := iter.Close(); err != nil {
		t.Fatalf("query with clustered_query_info info failed, err '%v'", err)
	}

	if value != "baz" {
		t.Fatalf("Expected value %s, but got %s", "baz", value)
	}

}

// TestBatchQueryInfo makes sure that the application can manually bind query parameters when executing in a batch
func TestBatchQueryInfo(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, cluster int, value text, PRIMARY KEY (id, cluster))", table)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}

	write := func(q *QueryInfo) ([]any, error) {
		values := make([]any, 3)
		values[0] = 4000
		values[1] = 5000
		values[2] = "bar"
		return values, nil
	}

	batch := session.Batch(LoggedBatch)
	batch.Bind(fmt.Sprintf("INSERT INTO %s (id, cluster, value) VALUES (?, ?,?)", table), write)

	if err := session.ExecuteBatch(batch); err != nil {
		t.Fatalf("batch insert into batch_query_info failed, err '%v'", err)
	}

	read := func(q *QueryInfo) ([]any, error) {
		values := make([]any, 2)
		values[0] = 4000
		values[1] = 5000
		return values, nil
	}

	qry := session.Bind(fmt.Sprintf("SELECT id, cluster, value FROM %s WHERE id = ? and cluster = ?", table), read)

	iter := qry.Iter()

	var id, cluster int
	var value string

	iter.Scan(&id, &cluster, &value)

	if err := iter.Close(); err != nil {
		t.Fatalf("query with batch_query_info info failed, err '%v'", err)
	}

	if value != "bar" {
		t.Fatalf("Expected value %s, but got %s", "bar", value)
	}
}

func getRandomConn(t *testing.T, session *Session) *Conn {
	conn := session.getConn()
	if conn == nil {
		t.Fatal("unable to get a connection")
	}
	return conn
}

func injectInvalidPreparedStatement(t *testing.T, session *Session, table string) (string, *Conn) {
	if err := createTable(session, `CREATE TABLE gocql_test.`+table+` (
			foo   varchar,
			bar   int,
			PRIMARY KEY (foo, bar)
	)`); err != nil {
		t.Fatal("create:", err)
	}

	stmt := "INSERT INTO " + table + " (foo, bar) VALUES (?, 7)"

	conn := getRandomConn(t, session)

	flight := new(inflightPrepare)
	key := session.stmtsLRU.keyFor(conn.host.HostID(), "", stmt)
	session.stmtsLRU.add(key, flight)

	flight.preparedStatment = &preparedStatment{
		id: []byte{'f', 'o', 'o', 'b', 'a', 'r'},
		request: preparedMetadata{
			resultMetadata: resultMetadata{
				colCount:       1,
				actualColCount: 1,
				columns: []ColumnInfo{
					{
						Keyspace: "gocql_test",
						Table:    table,
						Name:     "foo",
						TypeInfo: NativeType{
							typ: TypeVarchar,
						},
					},
				},
			},
		},
	}

	return stmt, conn
}

func TestPrepare_MissingSchemaPrepare(t *testing.T) {
	t.Parallel()

	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	s := createSession(t)
	conn := getRandomConn(t, s)
	defer s.Close()

	table := testTableName(t)

	insertQry := s.Query(fmt.Sprintf("INSERT INTO %s (val) VALUES (?)", table), 5)
	if err := conn.executeQuery(ctx, insertQry).err; err == nil {
		t.Fatal("expected error, but got nil.")
	}

	if err := createTable(s, fmt.Sprintf("CREATE TABLE gocql_test.%s (val int, PRIMARY KEY (val))", table)); err != nil {
		t.Fatal("create table:", err)
	}

	if err := conn.executeQuery(ctx, insertQry).err; err != nil {
		t.Fatal(err) // unconfigured columnfamily
	}
}

func TestPrepare_ReprepareStatement(t *testing.T) {
	t.Parallel()

	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	stmt, conn := injectInvalidPreparedStatement(t, session, table)
	query := session.Query(stmt, "bar")
	if err := conn.executeQuery(ctx, query).Close(); err != nil {
		t.Fatalf("Failed to execute query for reprepare statement: %v", err)
	}
}

func TestPrepare_ReprepareBatch(t *testing.T) {
	t.Parallel()

	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	stmt, conn := injectInvalidPreparedStatement(t, session, table)
	batch := session.Batch(UnloggedBatch)
	batch.Query(stmt, "bar")
	if err := conn.executeBatch(ctx, batch).Close(); err != nil {
		t.Fatalf("Failed to execute query for reprepare statement: %v", err)
	}
}

func TestQueryInfo(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	conn := getRandomConn(t, session)
	info, err := conn.prepareStatement(context.Background(), "SELECT release_version, host_id FROM system.local WHERE key = ?", nil, time.Second)

	if err != nil {
		t.Fatalf("Failed to execute query for preparing statement: %v", err)
	}

	if x := len(info.request.columns); x != 1 {
		t.Fatalf("Was not expecting meta data for %d query arguments, but got %d\n", 1, x)
	}

	if x := len(info.response.columns); x != 2 {
		t.Fatalf("Was not expecting meta data for %d result columns, but got %d\n", 2, x)
	}
}

// TestPreparedCacheEviction will make sure that the cache size is maintained
func TestPrepare_PreparedCacheEviction(t *testing.T) {
	t.Parallel()

	const maxPrepared = 4

	clusterHosts := getClusterHosts()
	host := clusterHosts[0]
	cluster := createCluster()
	cluster.MaxPreparedStmts = maxPrepared
	cluster.Events.DisableSchemaEvents = true
	cluster.Hosts = []string{host}

	cluster.HostFilter = WhiteListHostFilter(host)

	session := createSessionFromCluster(cluster, t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int,mod int,PRIMARY KEY (id))", table)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}
	// clear the cache
	session.stmtsLRU.clear()

	//Fill the table
	for i := 0; i < 2; i++ {
		if err := session.Query(fmt.Sprintf("INSERT INTO %s (id,mod) VALUES (?, ?)", table), i, 10000%(i+1)).Exec(); err != nil {
			t.Fatalf("insert into prepcachetest failed, err '%v'", err)
		}
	}
	//Populate the prepared statement cache with select statements
	var id, mod int
	for i := 0; i < 2; i++ {
		err := session.Query(fmt.Sprintf("SELECT id,mod FROM %s WHERE id = ", table)+strconv.FormatInt(int64(i), 10)).Scan(&id, &mod)
		if err != nil {
			t.Fatalf("select from prepcachetest failed, error '%v'", err)
		}
	}

	//generate an update statement to test they are prepared
	err := session.Query(fmt.Sprintf("UPDATE %s SET mod = ? WHERE id = ?", table), 1, 11).Exec()
	if err != nil {
		t.Fatalf("update prepcachetest failed, error '%v'", err)
	}

	//generate a delete statement to test they are prepared
	err = session.Query(fmt.Sprintf("DELETE FROM %s WHERE id = ?", table), 1).Exec()
	if err != nil {
		t.Fatalf("delete from prepcachetest failed, error '%v'", err)
	}

	//generate an insert statement to test they are prepared
	err = session.Query(fmt.Sprintf("INSERT INTO %s (id,mod) VALUES (?, ?)", table), 3, 11).Exec()
	if err != nil {
		t.Fatalf("insert into prepcachetest failed, error '%v'", err)
	}

	session.stmtsLRU.mu.Lock()
	defer session.stmtsLRU.mu.Unlock()

	//Make sure the cache size is maintained
	if session.stmtsLRU.lru.Len() != session.stmtsLRU.lru.MaxEntries {
		t.Fatalf("expected cache size of %v, got %v", session.stmtsLRU.lru.MaxEntries, session.stmtsLRU.lru.Len())
	}

	// Walk through all the configured hosts and test cache retention and eviction
	for _, host := range session.hostSource.hosts {
		_, ok := session.stmtsLRU.lru.Get(session.stmtsLRU.keyFor(host.HostID(), session.cfg.Keyspace, fmt.Sprintf("SELECT id,mod FROM %s WHERE id = 0", table)))
		if ok {
			t.Errorf("expected first select to be purged but was in cache for host=%q", host)
		}

		_, ok = session.stmtsLRU.lru.Get(session.stmtsLRU.keyFor(host.HostID(), session.cfg.Keyspace, fmt.Sprintf("SELECT id,mod FROM %s WHERE id = 1", table)))
		if !ok {
			t.Errorf("exepected second select to be in cache for host=%q", host)
		}

		_, ok = session.stmtsLRU.lru.Get(session.stmtsLRU.keyFor(host.HostID(), session.cfg.Keyspace, fmt.Sprintf("INSERT INTO %s (id,mod) VALUES (?, ?)", table)))
		if !ok {
			t.Errorf("expected insert to be in cache for host=%q", host)
		}

		_, ok = session.stmtsLRU.lru.Get(session.stmtsLRU.keyFor(host.HostID(), session.cfg.Keyspace, fmt.Sprintf("UPDATE %s SET mod = ? WHERE id = ?", table)))
		if !ok {
			t.Errorf("expected update to be in cached for host=%q", host)
		}

		_, ok = session.stmtsLRU.lru.Get(session.stmtsLRU.keyFor(host.HostID(), session.cfg.Keyspace, fmt.Sprintf("DELETE FROM %s WHERE id = ?", table)))
		if !ok {
			t.Errorf("expected delete to be cached for host=%q", host)
		}
	}
}

func TestPrepare_PreparedCacheKey(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	// create a second keyspace with a unique name to avoid collisions under parallel execution
	ks2 := testKeyspaceName(t, "ks2")
	cluster2 := createCluster()
	createKeyspace(t, cluster2, ks2, false)
	cluster2.Keyspace = ks2
	session2, err := cluster2.CreateSession()
	if err != nil {
		t.Fatal("create session:", err)
	}
	defer session2.Close()

	// both keyspaces have a table named "test_stmt_cache_key"
	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id varchar primary key, field varchar)", table)); err != nil {
		t.Fatal("create table:", err)
	}
	if err := createTable(session2, fmt.Sprintf("CREATE TABLE %s.%s (id varchar primary key, field varchar)", ks2, table)); err != nil {
		t.Fatal("create table:", err)
	}

	// both tables have a single row with the same partition key but different column value
	if err = session.Query(fmt.Sprintf(`INSERT INTO %s (id, field) VALUES (?, ?)`, table), "key", "one").Exec(); err != nil {
		t.Fatal("insert:", err)
	}
	if err = session2.Query(fmt.Sprintf(`INSERT INTO %s (id, field) VALUES (?, ?)`, table), "key", "two").Exec(); err != nil {
		t.Fatal("insert:", err)
	}

	// should be able to see different values in each keyspace
	var value string
	if err = session.Query(fmt.Sprintf("SELECT field FROM %s WHERE id = ?", table), "key").Scan(&value); err != nil {
		t.Fatal("select:", err)
	}
	if value != "one" {
		t.Errorf("Expected one, got %s", value)
	}

	if err = session2.Query(fmt.Sprintf("SELECT field FROM %s WHERE id = ?", table), "key").Scan(&value); err != nil {
		t.Fatal("select:", err)
	}
	if value != "two" {
		t.Errorf("Expected two, got %s", value)
	}
}

// TestMarshalFloat64Ptr tests to see that a pointer to a float64 is marshalled correctly.
func TestMarshalFloat64Ptr(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id double, test double, primary key (id))", table)); err != nil {
		t.Fatal("create table:", err)
	}
	testNum := float64(7500)
	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (id,test) VALUES (?,?)`, table), float64(7500.00), &testNum).Exec(); err != nil {
		t.Fatal("insert float64:", err)
	}
}

// TestMarshalInet tests to see that a pointer to a float64 is marshalled correctly.
func TestMarshalInet(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (ip inet, name text, primary key (ip))", table)); err != nil {
		t.Fatal("create table:", err)
	}
	stringIp := "123.34.45.56"
	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (ip,name) VALUES (?,?)`, table), stringIp, "Test IP 1").Exec(); err != nil {
		t.Fatal("insert string inet:", err)
	}
	var stringResult string
	if err := session.Query(fmt.Sprintf("SELECT ip FROM %s", table)).Scan(&stringResult); err != nil {
		t.Fatalf("select for string from table 1 failed: %v", err)
	}
	if stringResult != stringIp {
		t.Errorf("Expected %s, was %s", stringIp, stringResult)
	}

	var ipResult net.IP
	if err := session.Query(fmt.Sprintf("SELECT ip FROM %s", table)).Scan(&ipResult); err != nil {
		t.Fatalf("select for net.IP from table 1 failed: %v", err)
	}
	if ipResult.String() != stringIp {
		t.Errorf("Expected %s, was %s", stringIp, ipResult.String())
	}

	if err := session.Query(fmt.Sprintf(`DELETE FROM %s WHERE ip = ?`, table), stringIp).Exec(); err != nil {
		t.Fatal("delete inet table:", err)
	}

	netIp := net.ParseIP("222.43.54.65")
	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (ip,name) VALUES (?,?)`, table), netIp, "Test IP 2").Exec(); err != nil {
		t.Fatal("insert netIp inet:", err)
	}

	if err := session.Query(fmt.Sprintf("SELECT ip FROM %s", table)).Scan(&stringResult); err != nil {
		t.Fatalf("select for string from table 2 failed: %v", err)
	}
	if stringResult != netIp.String() {
		t.Errorf("Expected %s, was %s", netIp.String(), stringResult)
	}
	if err := session.Query(fmt.Sprintf("SELECT ip FROM %s", table)).Scan(&ipResult); err != nil {
		t.Fatalf("select for net.IP from table 2 failed: %v", err)
	}
	if ipResult.String() != netIp.String() {
		t.Errorf("Expected %s, was %s", netIp.String(), ipResult.String())
	}

}

func TestVarint(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id varchar, test varint, test2 varint, primary key (id))", table)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}

	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (id, test) VALUES (?, ?)`, table), "id", 0).Exec(); err != nil {
		t.Fatalf("insert varint: %v", err)
	}

	var result int
	if err := session.Query(fmt.Sprintf("SELECT test FROM %s", table)).Scan(&result); err != nil {
		t.Fatalf("select failed: %v", err)
	}

	if result != 0 {
		t.Errorf("Expected 0, was %d", result)
	}

	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (id, test) VALUES (?, ?)`, table), "id", -1).Exec(); err != nil {
		t.Fatalf("insert varint: %v", err)
	}

	if err := session.Query(fmt.Sprintf("SELECT test FROM %s", table)).Scan(&result); err != nil {
		t.Fatalf("select failed: %v", err)
	}

	if result != -1 {
		t.Errorf("Expected -1, was %d", result)
	}

	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (id, test) VALUES (?, ?)`, table), "id", nil).Exec(); err != nil {
		t.Fatalf("insert varint: %v", err)
	}

	if err := session.Query(fmt.Sprintf("SELECT test FROM %s", table)).Scan(&result); err != nil {
		t.Fatalf("select failed: %v", err)
	}

	if result != 0 {
		t.Errorf("Expected 0, was %d", result)
	}

	var nullableResult *int

	if err := session.Query(fmt.Sprintf("SELECT test FROM %s", table)).Scan(&nullableResult); err != nil {
		t.Fatalf("select failed: %v", err)
	}

	if nullableResult != nil {
		t.Errorf("Expected nil, was %d", nullableResult)
	}

	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (id, test) VALUES (?, ?)`, table), "id", int64(math.MaxInt32)+1).Exec(); err != nil {
		t.Fatalf("insert varint: %v", err)
	}

	var result64 int64
	if err := session.Query(fmt.Sprintf("SELECT test FROM %s", table)).Scan(&result64); err != nil {
		t.Fatalf("select failed: %v", err)
	}

	if result64 != int64(math.MaxInt32)+1 {
		t.Errorf("Expected %d, was %d", int64(math.MaxInt32)+1, result64)
	}

	biggie := new(big.Int)
	biggie.SetString("36893488147419103232", 10) // > 2**64
	if err := session.Query(fmt.Sprintf(`INSERT INTO %s (id, test) VALUES (?, ?)`, table), "id", biggie).Exec(); err != nil {
		t.Fatalf("insert varint: %v", err)
	}

	resultBig := new(big.Int)
	if err := session.Query(fmt.Sprintf("SELECT test FROM %s", table)).Scan(resultBig); err != nil {
		t.Fatalf("select failed: %v", err)
	}

	if resultBig.String() != biggie.String() {
		t.Errorf("Expected %s, was %s", biggie.String(), resultBig.String())
	}

	err := session.Query(fmt.Sprintf("SELECT test FROM %s", table)).Scan(&result64)
	if err == nil || strings.Index(err.Error(), "the data value should be in the int64 range") == -1 {
		t.Errorf("expected out of range error since value is too big for int64, result:%d", result64)
	}

	// value not set in cassandra, leave bind variable empty
	resultBig = new(big.Int)
	if err := session.Query(fmt.Sprintf("SELECT test2 FROM %s", table)).Scan(resultBig); err != nil {
		t.Fatalf("select failed: %v", err)
	}

	if resultBig.Int64() != 0 {
		t.Errorf("Expected %s, was %s", biggie.String(), resultBig.String())
	}

	// can use double pointer to explicitly detect value is not set in cassandra
	if err := session.Query(fmt.Sprintf("SELECT test2 FROM %s", table)).Scan(&resultBig); err != nil {
		t.Fatalf("select failed: %v", err)
	}

	if resultBig != nil {
		t.Errorf("Expected %v, was %v", nil, *resultBig)
	}
}

// TestQueryStats confirms that the stats are returning valid data. Accuracy may be questionable.
func TestQueryStats(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()
	qry := session.Query("SELECT * FROM system.peers")
	if err := qry.Exec(); err != nil {
		t.Fatalf("query failed. %v", err)
	} else {
		if qry.Attempts() < 1 {
			t.Fatal("expected at least 1 attempt, but got 0")
		}
		if qry.Latency() <= 0 {
			t.Fatalf("expected latency to be greater than 0, but got %v instead.", qry.Latency())
		}
	}
}

// TestIterHosts confirms that host is added to Iter when the query succeeds.
func TestIterHost(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()
	iter := session.Query("SELECT * FROM system.peers").Iter()

	// check if Host method works
	if iter.Host() == nil {
		t.Error("No host in iter")
	}
}

// TestBatchStats confirms that the stats are returning valid data. Accuracy may be questionable.
func TestBatchStats(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, PRIMARY KEY (id))", table)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}

	b := session.Batch(LoggedBatch)
	b.Query(fmt.Sprintf("INSERT INTO %s (id) VALUES (?)", table), 1)
	b.Query(fmt.Sprintf("INSERT INTO %s (id) VALUES (?)", table), 2)

	if err := session.ExecuteBatch(b); err != nil {
		t.Fatalf("query failed. %v", err)
	} else {
		if b.Attempts() < 1 {
			t.Fatal("expected at least 1 attempt, but got 0")
		}
		if b.Latency() <= 0 {
			t.Fatalf("expected latency to be greater than 0, but got %v instead.", b.Latency())
		}
	}
}

type funcBatchObserver func(context.Context, ObservedBatch)

func (f funcBatchObserver) ObserveBatch(ctx context.Context, o ObservedBatch) {
	f(ctx, o)
}

func TestBatchObserve(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (id int, other int, PRIMARY KEY (id))`, table)); err != nil {
		t.Fatal("create table:", err)
	}

	type observation struct {
		observedErr      error
		observedKeyspace string
		observedStmts    []string
		observedValues   [][]any
	}

	var observedBatch *observation

	batch := session.Batch(LoggedBatch)
	batch.Observer(funcBatchObserver(func(ctx context.Context, o ObservedBatch) {
		if observedBatch != nil {
			t.Fatal("batch observe called more than once")
		}

		observedBatch = &observation{
			observedKeyspace: o.Keyspace,
			observedStmts:    o.Statements,
			observedErr:      o.Err,
			observedValues:   o.Values,
		}
	}))
	for i := 0; i < 100; i++ {
		// hard coding 'i' into one of the values for better  testing of observation
		batch.Query(fmt.Sprintf(`INSERT INTO %s (id,other) VALUES (?,%d)`, table, i), i)
	}

	if err := session.ExecuteBatch(batch); err != nil {
		t.Fatal("execute batch:", err)
	}
	if observedBatch == nil {
		t.Fatal("batch observation has not been called")
	}
	if len(observedBatch.observedStmts) != 100 {
		t.Fatal("expecting 100 observed statements, got", len(observedBatch.observedStmts))
	}
	if observedBatch.observedErr != nil {
		t.Fatal("not expecting to observe an error", observedBatch.observedErr)
	}
	if observedBatch.observedKeyspace != "gocql_test" {
		t.Fatalf("expecting keyspace 'gocql_test', got %q", observedBatch.observedKeyspace)
	}
	for i, stmt := range observedBatch.observedStmts {
		if stmt != fmt.Sprintf(`INSERT INTO %s (id,other) VALUES (?,%d)`, table, i) {
			t.Fatal("unexpected query", stmt)
		}

		tests.AssertDeepEqual(t, "observed value", []any{i}, observedBatch.observedValues[i])
	}
}

// TestNilInQuery tests to see that a nil value passed to a query is handled by Cassandra
// TODO validate the nil value by reading back the nil. Need to fix Unmarshalling.
func TestNilInQuery(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, count int, PRIMARY KEY (id))", table)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}
	if err := session.Query(fmt.Sprintf("INSERT INTO %s (id,count) VALUES (?,?)", table), 1, nil).Exec(); err != nil {
		t.Fatalf("failed to insert with err: %v", err)
	}

	var id int

	if err := session.Query(fmt.Sprintf("SELECT id FROM %s", table)).Scan(&id); err != nil {
		t.Fatalf("failed to select with err: %v", err)
	} else if id != 1 {
		t.Fatalf("expected id to be 1, got %v", id)
	}
}

// Don't initialize time.Time bind variable if cassandra timestamp column is empty
func TestEmptyTimestamp(t *testing.T) {
	t.Parallel()

	session := createSession(t)

	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, time timestamp, num int, PRIMARY KEY (id))", table)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}

	if err := session.Query(fmt.Sprintf("INSERT INTO %s (id, num) VALUES (?,?)", table), 1, 561).Exec(); err != nil {
		t.Fatalf("failed to insert with err: %v", err)
	}

	var timeVal time.Time

	if err := session.Query(fmt.Sprintf("SELECT time FROM %s where id = ?", table), 1).Scan(&timeVal); err != nil {
		t.Fatalf("failed to select with err: %v", err)
	}

	if !timeVal.IsZero() {
		t.Errorf("time.Time bind variable should be zero (was %s)", timeVal)
	}
}

// Integration test of just querying for data from the system.schema_keyspace table where the keyspace DOES exist.
func TestGetKeyspaceMetadata(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	keyspaceMetadata, err := getKeyspaceMetadata(session, "gocql_test")
	if err != nil {
		t.Fatalf("failed to query the keyspace metadata with err: %v", err)
	}
	if keyspaceMetadata == nil {
		t.Fatal("failed to query the keyspace metadata, nil returned")
	}
	if keyspaceMetadata.Name != "gocql_test" {
		t.Errorf("Expected keyspace name to be 'gocql' but was '%s'", keyspaceMetadata.Name)
	}
	if keyspaceMetadata.StrategyClass != "org.apache.cassandra.locator.NetworkTopologyStrategy" {
		t.Errorf("Expected replication strategy class to be 'org.apache.cassandra.locator.NetworkTopologyStrategy' but was '%s'", keyspaceMetadata.StrategyClass)
	}
	if keyspaceMetadata.StrategyOptions == nil {
		t.Error("Expected replication strategy options map but was nil")
	}
	rfStr, ok := keyspaceMetadata.StrategyOptions["datacenter1"]
	if !ok {
		t.Fatalf("Expected strategy option 'datacenter1' but was not found in %v", keyspaceMetadata.StrategyOptions)
	}
	rfInt, err := strconv.Atoi(rfStr.(string))
	if err != nil {
		t.Fatalf("Error converting string to int with err: %v", err)
	}
	if rfInt != *flagRF {
		t.Errorf("Expected replication factor to be %d but was %d", *flagRF, rfInt)
	}
}

func TestSessionMetadataAPIs(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	const ks = "gocql_test"

	if _, err := session.KeyspaceMetadata(ks); err != nil {
		t.Fatalf("failed to get initial keyspace metadata: %v", err)
	}

	waitForSchemaRefresh := func() {
		if err := session.control.awaitSchemaAgreement(); err != nil {
			t.Logf("schema agreement warning: %v", err)
		}
		session.metadataDescriber.invalidateKeyspaceSchema(ks)
	}

	t.Run("TableMetadata", func(t *testing.T) {
		t.Run("basic_table_after_create", func(t *testing.T) {
			table := testTableName(t)
			if err := createTable(session, fmt.Sprintf(
				"CREATE TABLE IF NOT EXISTS %s.%s (pk int PRIMARY KEY, v int)", ks, table)); err != nil {
				t.Fatalf("create table: %v", err)
			}
			defer session.Query(fmt.Sprintf("DROP TABLE IF EXISTS %s.%s", ks, table)).Exec()

			waitForSchemaRefresh()

			tm, err := session.TableMetadata(ks, table)
			if err != nil {
				t.Fatalf("TableMetadata failed: %v", err)
			}
			if tm.Name != table {
				t.Errorf("expected table name %q, got %q", table, tm.Name)
			}
			if tm.Keyspace != ks {
				t.Errorf("expected keyspace %q, got %q", ks, tm.Keyspace)
			}
		})

		t.Run("columns_and_partition_key", func(t *testing.T) {
			table := testTableName(t)
			if err := createTable(session, fmt.Sprintf(
				"CREATE TABLE IF NOT EXISTS %s.%s (pk1 int, pk2 text, ck int, val blob, PRIMARY KEY ((pk1, pk2), ck))", ks, table)); err != nil {
				t.Fatalf("create table: %v", err)
			}
			defer session.Query(fmt.Sprintf("DROP TABLE IF EXISTS %s.%s", ks, table)).Exec()

			waitForSchemaRefresh()

			tm, err := session.TableMetadata(ks, table)
			if err != nil {
				t.Fatalf("TableMetadata failed: %v", err)
			}

			if len(tm.PartitionKey) != 2 {
				t.Fatalf("expected 2 partition key columns, got %d", len(tm.PartitionKey))
			}
			if tm.PartitionKey[0].Name != "pk1" || tm.PartitionKey[1].Name != "pk2" {
				t.Errorf("unexpected partition key columns: %v, %v", tm.PartitionKey[0].Name, tm.PartitionKey[1].Name)
			}

			if len(tm.ClusteringColumns) != 1 || tm.ClusteringColumns[0].Name != "ck" {
				t.Errorf("expected clustering column 'ck', got %v", tm.ClusteringColumns)
			}

			for _, col := range []string{"pk1", "pk2", "ck", "val"} {
				if _, ok := tm.Columns[col]; !ok {
					t.Errorf("expected column %q in metadata", col)
				}
			}
		})

		t.Run("with_secondary_index", func(t *testing.T) {
			if isTabletsSupported() {
				t.Skip("secondary indexes are not supported on tables with tablets")
			}

			table := testTableName(t)
			if err := createTable(session, fmt.Sprintf(
				"CREATE TABLE IF NOT EXISTS %s.%s (pk int PRIMARY KEY, v int)", ks, table)); err != nil {
				t.Fatalf("create table: %v", err)
			}
			defer session.Query(fmt.Sprintf("DROP TABLE IF EXISTS %s.%s", ks, table)).Exec()

			idxName := table + "_v_idx"
			if err := createTable(session, fmt.Sprintf(
				"CREATE INDEX IF NOT EXISTS %s ON %s.%s (v)", idxName, ks, table)); err != nil {
				t.Fatalf("create index: %v", err)
			}

			waitForSchemaRefresh()

			session.metadataDescriber.invalidateKeyspaceSchema(ks)
			km, err := session.KeyspaceMetadata(ks)
			if err != nil {
				t.Fatalf("KeyspaceMetadata failed: %v", err)
			}
			if _, ok := km.Indexes[idxName]; !ok {
				t.Errorf("expected index %q in keyspace metadata indexes", idxName)
			}
		})

		t.Run("with_materialized_view", func(t *testing.T) {
			if flagCassVersion.Before(3, 0, 0) {
				t.Skip("materialized views require Cassandra 3.0+")
			}
			if isTabletsSupported() {
				t.Skip("materialized views are not supported on tables with tablets")
			}

			baseTable := testTableName(t, "base")
			viewName := testTableName(t, "view")
			if err := createTable(session, fmt.Sprintf(
				"CREATE TABLE IF NOT EXISTS %s.%s (pk int, ck int, v int, PRIMARY KEY (pk, ck))", ks, baseTable)); err != nil {
				t.Fatalf("create base table: %v", err)
			}
			defer session.Query(fmt.Sprintf("DROP MATERIALIZED VIEW IF EXISTS %s.%s", ks, viewName)).Exec()
			defer session.Query(fmt.Sprintf("DROP TABLE IF EXISTS %s.%s", ks, baseTable)).Exec()

			if err := createTable(session, fmt.Sprintf(
				"CREATE MATERIALIZED VIEW IF NOT EXISTS %s.%s AS SELECT pk, ck, v FROM %s.%s WHERE pk IS NOT NULL AND ck IS NOT NULL AND v IS NOT NULL PRIMARY KEY (v, pk, ck)",
				ks, viewName, ks, baseTable)); err != nil {
				t.Fatalf("create materialized view: %v", err)
			}

			waitForSchemaRefresh()

			tm, err := session.TableMetadata(ks, baseTable)
			if err != nil {
				t.Fatalf("TableMetadata for base table failed: %v", err)
			}
			if tm.Name != baseTable {
				t.Errorf("expected table name %q, got %q", baseTable, tm.Name)
			}

			session.metadataDescriber.invalidateKeyspaceSchema(ks)
			km, err := session.KeyspaceMetadata(ks)
			if err != nil {
				t.Fatalf("KeyspaceMetadata failed: %v", err)
			}
			if _, ok := km.Views[viewName]; !ok {
				t.Errorf("expected view %q in keyspace metadata", viewName)
			}
			if km.Views[viewName].BaseTableName != baseTable {
				t.Errorf("expected view base table %q, got %q", baseTable, km.Views[viewName].BaseTableName)
			}
		})

		t.Run("after_alter_table", func(t *testing.T) {
			table := testTableName(t)
			if err := createTable(session, fmt.Sprintf(
				"CREATE TABLE IF NOT EXISTS %s.%s (pk int PRIMARY KEY, v int)", ks, table)); err != nil {
				t.Fatalf("create table: %v", err)
			}
			defer session.Query(fmt.Sprintf("DROP TABLE IF EXISTS %s.%s", ks, table)).Exec()

			if err := createTable(session, fmt.Sprintf(
				"ALTER TABLE %s.%s ADD v2 text", ks, table)); err != nil {
				t.Fatalf("alter table: %v", err)
			}

			waitForSchemaRefresh()

			tm, err := session.TableMetadata(ks, table)
			if err != nil {
				t.Fatalf("TableMetadata failed: %v", err)
			}
			if _, ok := tm.Columns["v2"]; !ok {
				t.Errorf("expected column 'v2' after ALTER TABLE, got columns: %v", columnNames(tm.Columns))
			}
		})

		t.Run("after_drop_and_recreate", func(t *testing.T) {
			table := testTableName(t)
			if err := createTable(session, fmt.Sprintf(
				"CREATE TABLE IF NOT EXISTS %s.%s (pk int PRIMARY KEY, v int)", ks, table)); err != nil {
				t.Fatalf("create table: %v", err)
			}

			waitForSchemaRefresh()

			if _, err := session.TableMetadata(ks, table); err != nil {
				t.Fatalf("TableMetadata before drop failed: %v", err)
			}

			if err := createTable(session, fmt.Sprintf("DROP TABLE %s.%s", ks, table)); err != nil {
				t.Fatalf("drop table: %v", err)
			}
			if err := createTable(session, fmt.Sprintf(
				"CREATE TABLE %s.%s (pk text PRIMARY KEY, new_col int)", ks, table)); err != nil {
				t.Fatalf("recreate table: %v", err)
			}
			defer session.Query(fmt.Sprintf("DROP TABLE IF EXISTS %s.%s", ks, table)).Exec()

			waitForSchemaRefresh()

			tm, err := session.TableMetadata(ks, table)
			if err != nil {
				t.Fatalf("TableMetadata after recreate failed: %v", err)
			}
			if _, ok := tm.Columns["new_col"]; !ok {
				t.Errorf("expected column 'new_col' after recreate, got columns: %v", columnNames(tm.Columns))
			}
			if _, ok := tm.Columns["v"]; ok {
				t.Errorf("old column 'v' should not exist after recreate")
			}
		})

		t.Run("nonexistent_table", func(t *testing.T) {
			_, err := session.TableMetadata(ks, "does_not_exist_at_all")
			if err == nil {
				t.Fatal("expected error for nonexistent table, got nil")
			}
			if !errors.Is(err, ErrNotFound) {
				t.Errorf("expected ErrNotFound, got: %v", err)
			}
		})

		t.Run("empty_table_name", func(t *testing.T) {
			_, err := session.TableMetadata(ks, "")
			if err == nil {
				t.Fatal("expected error for empty table name, got nil")
			}
			if !errors.Is(err, ErrNoTable) {
				t.Errorf("expected ErrNoTable, got: %v", err)
			}
		})

		t.Run("empty_keyspace", func(t *testing.T) {
			_, err := session.TableMetadata("", "some_table")
			if err == nil {
				t.Fatal("expected error for empty keyspace, got nil")
			}
			if !errors.Is(err, ErrNoKeyspace) {
				t.Errorf("expected ErrNoKeyspace, got: %v", err)
			}
		})
	})

	t.Run("KeyspaceMetadata", func(t *testing.T) {
		t.Run("includes_new_table", func(t *testing.T) {
			table := testTableName(t)
			if err := createTable(session, fmt.Sprintf(
				"CREATE TABLE IF NOT EXISTS %s.%s (pk int PRIMARY KEY, v int)", ks, table)); err != nil {
				t.Fatalf("create table: %v", err)
			}
			defer session.Query(fmt.Sprintf("DROP TABLE IF EXISTS %s.%s", ks, table)).Exec()

			waitForSchemaRefresh()

			session.metadataDescriber.invalidateKeyspaceSchema(ks)
			km, err := session.KeyspaceMetadata(ks)
			if err != nil {
				t.Fatalf("KeyspaceMetadata failed: %v", err)
			}
			if _, ok := km.Tables[table]; !ok {
				t.Fatalf("expected table %q in keyspace metadata, got tables: %v", table, tableNames(km.Tables))
			}
		})

		t.Run("excludes_dropped_table", func(t *testing.T) {
			table := testTableName(t)
			if err := createTable(session, fmt.Sprintf(
				"CREATE TABLE IF NOT EXISTS %s.%s (pk int PRIMARY KEY, v int)", ks, table)); err != nil {
				t.Fatalf("create table: %v", err)
			}

			waitForSchemaRefresh()

			session.metadataDescriber.invalidateKeyspaceSchema(ks)
			km, err := session.KeyspaceMetadata(ks)
			if err != nil {
				t.Fatalf("KeyspaceMetadata before drop failed: %v", err)
			}
			if _, ok := km.Tables[table]; !ok {
				t.Fatalf("expected table %q before drop", table)
			}

			if err := createTable(session, fmt.Sprintf("DROP TABLE %s.%s", ks, table)); err != nil {
				t.Fatalf("drop table: %v", err)
			}

			waitForSchemaRefresh()

			session.metadataDescriber.invalidateKeyspaceSchema(ks)
			km, err = session.KeyspaceMetadata(ks)
			if err != nil {
				t.Fatalf("KeyspaceMetadata after drop failed: %v", err)
			}
			if _, ok := km.Tables[table]; ok {
				t.Errorf("table %q should not appear after DROP", table)
			}
		})

		t.Run("multiple_tables", func(t *testing.T) {
			tables := []string{testTableName(t, "a"), testTableName(t, "b"), testTableName(t, "c")}
			for _, table := range tables {
				if err := createTable(session, fmt.Sprintf(
					"CREATE TABLE IF NOT EXISTS %s.%s (pk int PRIMARY KEY)", ks, table)); err != nil {
					t.Fatalf("create table %s: %v", table, err)
				}
				defer session.Query(fmt.Sprintf("DROP TABLE IF EXISTS %s.%s", ks, table)).Exec()
			}

			waitForSchemaRefresh()

			session.metadataDescriber.invalidateKeyspaceSchema(ks)
			km, err := session.KeyspaceMetadata(ks)
			if err != nil {
				t.Fatalf("KeyspaceMetadata failed: %v", err)
			}
			for _, table := range tables {
				if _, ok := km.Tables[table]; !ok {
					t.Errorf("expected table %q in keyspace metadata", table)
				}
			}
		})

		t.Run("nonexistent_keyspace", func(t *testing.T) {
			_, err := session.KeyspaceMetadata("keyspace_that_does_not_exist_xyz")
			if err == nil {
				t.Fatal("expected error for nonexistent keyspace, got nil")
			}
		})

		t.Run("empty_keyspace", func(t *testing.T) {
			_, err := session.KeyspaceMetadata("")
			if err == nil {
				t.Fatal("expected error for empty keyspace, got nil")
			}
			if !errors.Is(err, ErrNoKeyspace) {
				t.Errorf("expected ErrNoKeyspace, got: %v", err)
			}
		})
	})
}

func tableNames(tables map[string]*TableMetadata) []string {
	names := make([]string, 0, len(tables))
	for name := range tables {
		names = append(names, name)
	}
	return names
}

func columnNames(columns map[string]*ColumnMetadata) []string {
	names := make([]string, 0, len(columns))
	for name := range columns {
		names = append(names, name)
	}
	return names
}

// Integration test of just querying for data from the system.schema_keyspace table where the keyspace DOES NOT exist.
func TestGetKeyspaceMetadataFails(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	_, err := getKeyspaceMetadata(session, "gocql_keyspace_does_not_exist")

	if err != ErrKeyspaceDoesNotExist || err == nil {
		t.Fatalf("Expected error of type ErrKeySpaceDoesNotExist. Instead, error was %v", err)
	}
}

// Integration test of the routing key calculation
func TestRoutingKey(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	singleTable := testTableName(t, "single")
	compositeTable := testTableName(t, "composite")

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (first_id int, second_id int, PRIMARY KEY (first_id, second_id))", singleTable)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}
	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (first_id int, second_id int, PRIMARY KEY ((first_id, second_id)))", compositeTable)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}

	initCacheSize := session.routingKeyInfoCache.lru.Len()

	routingKeyInfo, err := session.routingKeyInfo(context.Background(), fmt.Sprintf("SELECT * FROM %s WHERE second_id=? AND first_id=?", singleTable), time.Second)
	if err != nil {
		t.Fatalf("failed to get routing key info due to error: %v", err)
	}
	if routingKeyInfo == nil {
		t.Fatal("Expected routing key info, but was nil")
	}
	if len(routingKeyInfo.indexes) != 1 {
		t.Fatalf("Expected routing key indexes length to be 1 but was %d", len(routingKeyInfo.indexes))
	}
	if routingKeyInfo.indexes[0] != 1 {
		t.Errorf("Expected routing key index[0] to be 1 but was %d", routingKeyInfo.indexes[0])
	}
	if len(routingKeyInfo.types) != 1 {
		t.Fatalf("Expected routing key types length to be 1 but was %d", len(routingKeyInfo.types))
	}
	if routingKeyInfo.types[0] == nil {
		t.Fatal("Expected routing key types[0] to be non-nil")
	}
	if routingKeyInfo.types[0].Type() != TypeInt {
		t.Fatalf("Expected routing key types[0].Type to be %v but was %v", TypeInt, routingKeyInfo.types[0].Type())
	}

	// verify the cache is working
	routingKeyInfo, err = session.routingKeyInfo(
		context.Background(),
		fmt.Sprintf("SELECT * FROM %s WHERE second_id=? AND first_id=?", singleTable),
		// Routing info will be pulled from cached prepared statement, it should work with minimal timeout
		time.Nanosecond)
	if err != nil {
		t.Fatalf("failed to get routing key info due to error: %v", err)
	}
	if len(routingKeyInfo.indexes) != 1 {
		t.Fatalf("Expected routing key indexes length to be 1 but was %d", len(routingKeyInfo.indexes))
	}
	if routingKeyInfo.indexes[0] != 1 {
		t.Errorf("Expected routing key index[0] to be 1 but was %d", routingKeyInfo.indexes[0])
	}
	if len(routingKeyInfo.types) != 1 {
		t.Fatalf("Expected routing key types length to be 1 but was %d", len(routingKeyInfo.types))
	}
	if routingKeyInfo.types[0] == nil {
		t.Fatal("Expected routing key types[0] to be non-nil")
	}
	if routingKeyInfo.types[0].Type() != TypeInt {
		t.Fatalf("Expected routing key types[0] to be %v but was %v", TypeInt, routingKeyInfo.types[0].Type())
	}
	cacheSize := session.routingKeyInfoCache.lru.Len()
	if cacheSize != initCacheSize+1 {
		t.Errorf("Expected cache size to be %d but was %d", initCacheSize+1, cacheSize)
	}

	query := session.Query(fmt.Sprintf("SELECT * FROM %s WHERE second_id=? AND first_id=?", singleTable), 1, 2)
	routingKey, err := query.GetRoutingKey()
	if err != nil {
		t.Fatalf("Failed to get routing key due to error: %v", err)
	}
	expectedRoutingKey := []byte{0, 0, 0, 2}
	if !reflect.DeepEqual(expectedRoutingKey, routingKey) {
		t.Errorf("Expected routing key %v but was %v", expectedRoutingKey, routingKey)
	}

	routingKeyInfo, err = session.routingKeyInfo(
		context.Background(),
		fmt.Sprintf("SELECT * FROM %s WHERE second_id=? AND first_id=?", compositeTable),
		time.Second)
	if err != nil {
		t.Fatalf("failed to get routing key info due to error: %v", err)
	}
	if routingKeyInfo == nil {
		t.Fatal("Expected routing key info, but was nil")
	}
	if len(routingKeyInfo.indexes) != 2 {
		t.Fatalf("Expected routing key indexes length to be 2 but was %d", len(routingKeyInfo.indexes))
	}
	if routingKeyInfo.indexes[0] != 1 {
		t.Errorf("Expected routing key index[0] to be 1 but was %d", routingKeyInfo.indexes[0])
	}
	if routingKeyInfo.indexes[1] != 0 {
		t.Errorf("Expected routing key index[1] to be 0 but was %d", routingKeyInfo.indexes[1])
	}
	if len(routingKeyInfo.types) != 2 {
		t.Fatalf("Expected routing key types length to be 1 but was %d", len(routingKeyInfo.types))
	}
	if routingKeyInfo.types[0] == nil {
		t.Fatal("Expected routing key types[0] to be non-nil")
	}
	if routingKeyInfo.types[0].Type() != TypeInt {
		t.Fatalf("Expected routing key types[0] to be %v but was %v", TypeInt, routingKeyInfo.types[0].Type())
	}
	if routingKeyInfo.types[1] == nil {
		t.Fatal("Expected routing key types[1] to be non-nil")
	}
	if routingKeyInfo.types[1].Type() != TypeInt {
		t.Fatalf("Expected routing key types[0] to be %v but was %v", TypeInt, routingKeyInfo.types[1].Type())
	}

	query = session.Query(fmt.Sprintf("SELECT * FROM %s WHERE second_id=? AND first_id=?", compositeTable), 1, 2)
	routingKey, err = query.GetRoutingKey()
	if err != nil {
		t.Fatalf("Failed to get routing key due to error: %v", err)
	}
	expectedRoutingKey = []byte{0, 4, 0, 0, 0, 2, 0, 0, 4, 0, 0, 0, 1, 0}
	if !reflect.DeepEqual(expectedRoutingKey, routingKey) {
		t.Errorf("Expected routing key %v but was %v", expectedRoutingKey, routingKey)
	}

	// verify the cache is working
	cacheSize = session.routingKeyInfoCache.lru.Len()
	if cacheSize != initCacheSize+2 {
		t.Errorf("Expected cache size to be %d but was %d", initCacheSize+2, cacheSize)
	}
}

// Integration test of the token-aware policy-based connection pool
func TestTokenAwareConnPool(t *testing.T) {
	t.Parallel()

	cluster := createCluster()
	cluster.PoolConfig.HostSelectionPolicy = TokenAwareHostPolicy(RoundRobinHostPolicy())

	// force metadata query to page
	cluster.PageSize = 1

	session := createSessionFromCluster(cluster, t)
	defer session.Close()

	expectedPoolSize := cluster.NumConns * len(session.hostSource.getHostsList())

	// wait for pool to fill
	for i := 0; i < 50; i++ {
		if session.pool.Size() == expectedPoolSize {
			break
		}
		time.Sleep(100 * time.Millisecond)
	}

	if expectedPoolSize != session.pool.Size() {
		t.Errorf("Expected pool size %d but was %d", expectedPoolSize, session.pool.Size())
	}

	table := testTableName(t)
	otherTable := testTableName(t, "other")

	// add another cf so there are two pages when fetching table metadata from our keyspace
	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, data text, PRIMARY KEY (id))", otherTable)); err != nil {
		t.Fatalf("failed to create test_token_aware table with err: %v", err)
	}

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, data text, PRIMARY KEY (id))", table)); err != nil {
		t.Fatalf("failed to create test_token_aware table with err: %v", err)
	}
	query := session.Query(fmt.Sprintf("INSERT INTO %s (id, data) VALUES (?,?)", table), 42, "8 * 6 =")
	if err := query.Exec(); err != nil {
		t.Fatalf("failed to insert with err: %v", err)
	}

	query = session.Query(fmt.Sprintf("SELECT data FROM %s where id = ?", table), 42).Consistency(One)
	var data string
	if err := query.Scan(&data); err != nil {
		t.Error(err)
	}

	// TODO add verification that the query went to the correct host
}

func TestNegativeStream(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	conn := getRandomConn(t, session)

	const stream = -50
	writer := frameWriterFunc(func(f *framer, streamID int) error {
		f.writeHeader(0, frm.OpOptions, stream)
		return f.finish()
	})

	frame, err := conn.exec(context.Background(), writer, nil, time.Second)
	if err == nil {
		t.Fatalf("expected to get an error on stream %d", stream)
	} else if frame != nil {
		t.Fatalf("expected to get nil frame got %+v", frame)
	}
}

func TestManualQueryPaging(t *testing.T) {
	t.Parallel()

	const rowsToInsert = 5

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, count int, PRIMARY KEY (id))", table)); err != nil {
		t.Fatal(err)
	}

	for i := 0; i < rowsToInsert; i++ {
		err := session.Query(fmt.Sprintf("INSERT INTO %s(id, count) VALUES(?, ?)", table), i, i*i).Exec()
		if err != nil {
			t.Fatal(err)
		}
	}

	// disable auto paging, 1 page per iteration
	query := session.Query(fmt.Sprintf("SELECT id, count FROM %s", table)).PageState(nil).PageSize(2)
	var id, count, fetched int

	iter := query.Iter()
	// NOTE: this isnt very indicative of how it should be used, the idea is that
	// the page state is returned to some client who will send it back to manually
	// page through the results.
	for {
		for iter.Scan(&id, &count) {
			if count != (id * id) {
				t.Fatalf("got wrong value from iteration: got %d expected %d", count, id*id)
			}

			fetched++
		}

		if !iter.LastPage() {
			// more pages
			iter = query.PageState(iter.PageState()).Iter()
		} else {
			break
		}
	}

	if err := iter.Close(); err != nil {
		t.Fatal(err)
	}

	if fetched != rowsToInsert {
		t.Fatalf("expected to fetch %d rows got %d", rowsToInsert, fetched)
	}
}

// Issue 475
func TestSessionBindRoutingKey(t *testing.T) {
	t.Parallel()

	cluster := createCluster()
	cluster.PoolConfig.HostSelectionPolicy = TokenAwareHostPolicy(RoundRobinHostPolicy())

	session := createSessionFromCluster(cluster, t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (
			key     varchar,
			value   int,
			PRIMARY KEY (key)
		)`, table)); err != nil {

		t.Fatal(err)
	}

	const (
		key   = "routing-key"
		value = 5
	)

	fn := func(info *QueryInfo) ([]any, error) {
		return []any{key, value}, nil
	}

	q := session.Bind(fmt.Sprintf("INSERT INTO %s(key, value) VALUES(?, ?)", table), fn)
	if err := q.Exec(); err != nil {
		t.Fatal(err)
	}
}

func TestJSONSupport(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	if session.cfg.ProtoVersion < protoVersion4 {
		t.Skip("skipping JSON support on proto < 4")
	}

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (
		    id text PRIMARY KEY,
		    age int,
		    state text
		)`, table)); err != nil {

		t.Fatal(err)
	}

	err := session.Query(fmt.Sprintf("INSERT INTO %s JSON ?", table), `{"id": "user123", "age": 42, "state": "TX"}`).Exec()
	if err != nil {
		t.Fatal(err)
	}

	var (
		id    string
		age   int
		state string
	)

	err = session.Query(fmt.Sprintf("SELECT id, age, state FROM %s WHERE id = ?", table), "user123").Scan(&id, &age, &state)
	if err != nil {
		t.Fatal(err)
	}

	if id != "user123" {
		t.Errorf("got id %q expected %q", id, "user123")
	}
	if age != 42 {
		t.Errorf("got age %d expected %d", age, 42)
	}
	if state != "TX" {
		t.Errorf("got state %q expected %q", state, "TX")
	}
}

func TestUnmarshallNestedTypes(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (
		    id text PRIMARY KEY,
		    val list<frozen<map<text, text> > >
		)`, table)); err != nil {

		t.Fatal(err)
	}

	m := []map[string]string{
		{"key1": "val1"},
		{"key2": "val2"},
	}

	const id = "key"
	err := session.Query(fmt.Sprintf("INSERT INTO %s(id, val) VALUES(?, ?)", table), id, m).Exec()
	if err != nil {
		t.Fatal(err)
	}

	var data []map[string]string
	if err := session.Query(fmt.Sprintf("SELECT val FROM %s WHERE id = ?", table), id).Scan(&data); err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(data, m) {
		t.Fatalf("%+#v != %+#v", data, m)
	}
}

func TestSchemaReset(t *testing.T) {
	t.Parallel()

	if flagCassVersion.Major == 0 || flagCassVersion.Before(2, 1, 3) {
		t.Skipf("skipping TestSchemaReset due to CASSANDRA-7910 in Cassandra <2.1.3 version=%v", flagCassVersion)
	}

	cluster := createCluster()
	cluster.NumConns = 1

	session := createSessionFromCluster(cluster, t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf(`CREATE TABLE gocql_test.%s (
		id text PRIMARY KEY)`, table)); err != nil {

		t.Fatal(err)
	}

	const key = "test"

	err := session.Query(fmt.Sprintf("INSERT INTO %s(id) VALUES(?)", table), key).Exec()
	if err != nil {
		t.Fatal(err)
	}

	var id string
	err = session.Query(fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), key).Scan(&id)
	if err != nil {
		t.Fatal(err)
	} else if id != key {
		t.Fatalf("expected to get id=%q got=%q", key, id)
	}

	if err := createTable(session, fmt.Sprintf(`ALTER TABLE gocql_test.%s ADD val text`, table)); err != nil {
		t.Fatal(err)
	}

	const expVal = "test-val"
	err = session.Query(fmt.Sprintf("INSERT INTO %s(id, val) VALUES(?, ?)", table), key, expVal).Exec()
	if err != nil {
		t.Fatal(err)
	}

	var val string
	err = session.Query(fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), key).Scan(&id, &val)
	if err != nil {
		t.Fatal(err)
	}

	if id != key {
		t.Errorf("expected to get id=%q got=%q", key, id)
	}
	if val != expVal {
		t.Errorf("expected to get val=%q got=%q", expVal, val)
	}
}

func TestCreateSession_DontSwallowError(t *testing.T) {
	t.Parallel()

	t.Skip("This test is bad, and the resultant error from cassandra changes between versions")
	cluster := createCluster()
	cluster.ProtoVersion = 0x100
	session, err := cluster.CreateSession()
	if err == nil {
		session.Close()

		t.Fatal("expected to get an error for unsupported protocol")
	}

	if flagCassVersion.Major < 3 {
		// TODO: we should get a distinct error type here which include the underlying
		// cassandra error about the protocol version, for now check this here.
		if !strings.Contains(err.Error(), "Invalid or unsupported protocol version") {
			t.Fatalf(`expcted to get error "unsupported protocol version" got: %q`, err)
		}
	} else {
		if !strings.Contains(err.Error(), "unsupported response version") {
			t.Fatalf(`expcted to get error "unsupported response version" got: %q`, err)
		}
	}
}

func TestControl_DiscoverProtocol(t *testing.T) {
	t.Parallel()

	cluster := createCluster()
	cluster.ProtoVersion = 0

	session, err := cluster.CreateSession()
	if err != nil {
		t.Fatal(err)
	}
	defer session.Close()

	if session.cfg.ProtoVersion == 0 {
		t.Fatal("did not discovery protocol")
	}
}

// TestUnsetCol verify unset column will not replace an existing column
func TestUnsetCol(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	if session.cfg.ProtoVersion < protoVersion4 {
		t.Skip("Unset Values are not supported in protocol < 4")
	}

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, my_int int, my_text text, PRIMARY KEY (id))", table)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}
	if err := session.Query(fmt.Sprintf("INSERT INTO %s (id,my_int,my_text) VALUES (?,?,?)", table), 1, 2, "3").Exec(); err != nil {
		t.Fatalf("failed to insert with err: %v", err)
	}
	if err := session.Query(fmt.Sprintf("INSERT INTO %s (id,my_int,my_text) VALUES (?,?,?)", table), 1, UnsetValue, UnsetValue).Exec(); err != nil {
		t.Fatalf("failed to insert with err: %v", err)
	}

	var id, mInt int
	var mText string

	if err := session.Query(fmt.Sprintf("SELECT id, my_int ,my_text FROM %s", table)).Scan(&id, &mInt, &mText); err != nil {
		t.Fatalf("failed to select with err: %v", err)
	} else if id != 1 || mInt != 2 || mText != "3" {
		t.Fatalf("Expected results: 1, 2, \"3\", got %v, %v, %v", id, mInt, mText)
	}
}

// TestUnsetColBatch verify unset column will not replace a column in batch
func TestUnsetColBatch(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	if session.cfg.ProtoVersion < protoVersion4 {
		t.Skip("Unset Values are not supported in protocol < 4")
	}

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s (id int, my_int int, my_text text, PRIMARY KEY (id))", table)); err != nil {
		t.Fatalf("failed to create table with error '%v'", err)
	}

	b := session.Batch(LoggedBatch)
	b.Query(fmt.Sprintf("INSERT INTO gocql_test.%s(id, my_int, my_text) VALUES (?,?,?)", table), 1, 1, UnsetValue)
	b.Query(fmt.Sprintf("INSERT INTO gocql_test.%s(id, my_int, my_text) VALUES (?,?,?)", table), 1, UnsetValue, "")
	b.Query(fmt.Sprintf("INSERT INTO gocql_test.%s(id, my_int, my_text) VALUES (?,?,?)", table), 2, 2, UnsetValue)

	if err := session.ExecuteBatch(b); err != nil {
		t.Fatalf("query failed. %v", err)
	} else {
		if b.Attempts() < 1 {
			t.Fatal("expected at least 1 attempt, but got 0")
		}
		if b.Latency() <= 0 {
			t.Fatalf("expected latency to be greater than 0, but got %v instead.", b.Latency())
		}
	}
	var id, mInt, count int
	var mText string
	if err := session.Query(fmt.Sprintf("SELECT count(*) FROM gocql_test.%s;", table)).Scan(&count); err != nil {
		t.Fatalf("Failed to select with err: %v", err)
	} else if count != 2 {
		t.Fatalf("Expected Batch Insert count 2, got %v", count)
	}

	if err := session.Query(fmt.Sprintf("SELECT id, my_int ,my_text FROM gocql_test.%s where id=1;", table)).Scan(&id, &mInt, &mText); err != nil {
		t.Fatalf("failed to select with err: %v", err)
	} else if id != mInt {
		t.Fatalf("expected id, my_int to be 1, got %v and %v", id, mInt)
	}
}

func TestQuery_NamedValues(t *testing.T) {
	t.Parallel()

	session := createSession(t)
	defer session.Close()

	table := testTableName(t)

	if err := createTable(session, fmt.Sprintf("CREATE TABLE gocql_test.%s(id int, value text, PRIMARY KEY (id))", table)); err != nil {
		t.Fatal(err)
	}

	err := session.Query(fmt.Sprintf("INSERT INTO gocql_test.%s(id, value) VALUES(:id, :value)", table), NamedValue("id", 1), NamedValue("value", "i am a value")).Exec()
	if err != nil {
		t.Fatal(err)
	}
	var value string
	if err := session.Query(fmt.Sprintf("SELECT VALUE from gocql_test.%s WHERE id = :id", table), NamedValue("id", 1)).Scan(&value); err != nil {
		t.Fatal(err)
	}
}

// TestQuery_SetHostID ensures that queries are sent to the specified host only.
// WARNING: This test must NOT use t.Parallel(). It calls pool.host.setState(NodeDown)
// which mutates shared HostInfo state visible to all concurrent sessions.
//
//nolint:paralleltest // mutates shared HostInfo state via setState(NodeDown)
func TestQuery_SetHostID(t *testing.T) {
	session := createSession(t)
	defer session.Close()

	hosts := session.GetHosts()

	const iterations = 5
	for _, expectedHost := range hosts {
		for i := 0; i < iterations; i++ {
			var actualHostID string
			err := session.Query("SELECT host_id FROM system.local").
				SetHostID(expectedHost.HostID()).
				Scan(&actualHostID)
			if err != nil {
				t.Fatal(err)
			}

			if expectedHost.HostID() != actualHostID {
				t.Fatalf("Expected query to be executed on host %s, but it was executed on %s",
					expectedHost.HostID(),
					actualHostID,
				)
			}
		}
	}

	// ensuring properly handled invalid host id
	err := session.Query("SELECT host_id FROM system.local").
		SetHostID("[invalid]").
		Exec()
	if !errors.Is(err, ErrNoPool) {
		t.Fatalf("Expected error to be: %v, but got %v", ErrNoPool, err)
	}

	// ensuring that the driver properly handles the case
	// when specified host for the query is down
	host := hosts[0]
	pool, _ := session.pool.getPoolByHostID(host.HostID())
	// simulating specified host is down
	pool.host.setState(NodeDown)
	err = session.Query("SELECT host_id FROM system.local").
		SetHostID(host.HostID()).
		Exec()
	if !errors.Is(err, ErrHostDown) {
		t.Fatalf("Expected error to be: %v, but got %v", ErrHostDown, err)
	}
}


================================================
FILE: ci/clean-old-temporary-docker-images.py
================================================
import os
import requests
from datetime import datetime, timedelta

DOCKERHUB_USERNAME = os.environ["DOCKERHUB_USERNAME"]
DOCKERHUB_TOKEN = os.environ["DOCKERHUB_TOKEN"]
DELETE_AFTER_DAYS = os.environ["DELETE_AFTER_DAYS"]

def get_docker_token(username, password):
    url = "https://hub.docker.com/v2/users/login/"
    headers = {"Content-Type": "application/json"}
    data = {"username": username, "password": password}

    response = requests.post(url, json=data, headers=headers)
    if response.status_code == 200:
        return response.json()["token"]
    else:
        print(f"Failed to login to DockerHub: {response.status_code}")
        return None

def get_repo_tags(token):
    url = f"https://hub.docker.com/v2/repositories/scylladb/gocql-extended-ci/tags/"
    headers = {"Authorization": f"Bearer {token}"}
    response = requests.get(url, headers=headers)
    if response.status_code != 200:
        print(f"Failed to get tags, Status Code: {response.status_code}, {response.text}")
        return None
    return response.json()["results"]

def delete_tag(tag, token):
    url = f"https://hub.docker.com/v2/repositories/scylladb/gocql-extended-ci/tags/{tag}/"
    headers = {"Authorization": f"Bearer {token}"}
    response = requests.delete(url, headers=headers)
    if response.status_code > 200 and response.status_code < 300:
        print(f"Deleted tag: {tag}")
        return True
    print(f"Failed to delete tag: {tag}, Status Code: {response.status_code}")
    return False

def clean_old_images():
    token = get_docker_token(DOCKERHUB_USERNAME, DOCKERHUB_TOKEN)
    if token is None:
        return False
    tags = get_repo_tags(token)
    if tags is None:
        return False
    threshold_date = datetime.now() - timedelta(days=int(DELETE_AFTER_DAYS))
    status = True
    for tag in tags:
        last_updated = datetime.strptime(tag["last_updated"], "%Y-%m-%dT%H:%M:%S.%fZ")
        if last_updated < threshold_date:
            status = status and delete_tag(tag["name"], token)
    return status

if __name__ == "__main__":
    if not clean_old_images():
        exit(1)
    exit(0)


================================================
FILE: client_routes.go
================================================
package gocql

import (
	"errors"
	"fmt"
	"net"
	"slices"
	"strings"
	"sync"
	"sync/atomic"
	"time"

	"github.com/gocql/gocql/events"
	"github.com/gocql/gocql/internal/debug"
	"github.com/gocql/gocql/internal/eventbus"
)

type ClientRoutesEndpoint struct {
	// Scylla Cloud ConnectionID to read from `system.client_routes`
	ConnectionID string

	// Ip Address or DNS name of the AWS endpoint
	// Could stay empty, in this case driver will pick it up from system.client_routes table
	ConnectionAddr string
}

func (e ClientRoutesEndpoint) Validate() error {
	if e.ConnectionID == "" {
		return errors.New("missing ConnectionID")
	}
	return 
Download .txt
gitextract_l7q0abss/

├── .git-blame-ignore-revs
├── .github/
│   ├── dependabot.yml
│   ├── issue_template.md
│   └── workflows/
│       ├── bench-tests.yml
│       ├── call_jira_sync.yml
│       ├── clean_dockerhub_images.yml
│       ├── docs-pages.yml
│       ├── docs-pr.yml
│       ├── extended-ci-longevity-large-partitions-with-network-nemesis-1h-test.yml
│       └── main.yml
├── .gitignore
├── .golangci.yml
├── CONTRIBUTING.md
├── LICENSE
├── Makefile
├── NOTICE
├── README.md
├── address_translators.go
├── address_translators_test.go
├── batch_test.go
├── callreq_wait.go
├── callreq_wait_race.go
├── cass1batch_test.go
├── cassandra_test.go
├── ci/
│   └── clean-old-temporary-docker-images.py
├── client_routes.go
├── client_routes_test.go
├── client_routes_unit_test.go
├── cloud_cluster_test.go
├── cluster.go
├── cluster_test.go
├── common_test.go
├── compressor.go
├── compressor_test.go
├── conn.go
├── conn_test.go
├── connectionpool.go
├── connectionpool_test.go
├── connpicker.go
├── control.go
├── control_integration_test.go
├── control_test.go
├── cqltypes.go
├── debounce/
│   ├── refresh_deboucer.go
│   ├── refresh_debouncer_test.go
│   ├── simple_debouncer.go
│   └── simple_debouncer_test.go
├── dial.go
├── dialer/
│   ├── recorder/
│   │   └── recorder.go
│   ├── replayer/
│   │   └── replayer.go
│   └── utils.go
├── dns_test.go
├── doc.go
├── docs/
│   ├── Makefile
│   ├── _utils/
│   │   └── redirects.yaml
│   ├── pyproject.toml
│   └── source/
│       ├── conf.py
│       ├── index.rst
│       └── sample-page.rst
├── errors.go
├── errors_test.go
├── events/
│   ├── event_converter.go
│   ├── event_converter_test.go
│   ├── events.go
│   └── events_test.go
├── events.go
├── events_test.go
├── events_unit_test.go
├── example_batch_test.go
├── example_dynamic_columns_test.go
├── example_lwt_batch_test.go
├── example_lwt_test.go
├── example_marshaler_test.go
├── example_nulls_test.go
├── example_paging_test.go
├── example_set_test.go
├── example_test.go
├── example_udt_map_test.go
├── example_udt_marshaler_test.go
├── example_udt_struct_test.go
├── example_udt_unmarshaler_test.go
├── exec.go
├── exec_test.go
├── export_test.go
├── filters.go
├── filters_test.go
├── frame.go
├── frame_test.go
├── framer.go
├── framer_bench_test.go
├── go.mod
├── go.sum
├── helpers.go
├── helpers_bench_test.go
├── host_source.go
├── host_source_scylla.go
├── host_source_test.go
├── hostpolicy/
│   ├── hostpool.go
│   └── hostpool_test.go
├── install_test_deps.sh
├── integration.sh
├── integration_only.go
├── integration_serialization_scylla_test.go
├── integration_test.go
├── internal/
│   ├── ccm/
│   │   ├── ccm.go
│   │   └── ccm_test.go
│   ├── debug/
│   │   ├── debug_off.go
│   │   └── debug_on.go
│   ├── eventbus/
│   │   ├── README.md
│   │   ├── eventbus.go
│   │   ├── eventbus_test.go
│   │   └── example_test.go
│   ├── frame/
│   │   └── frames.go
│   ├── lru/
│   │   ├── lru.go
│   │   └── lru_test.go
│   ├── murmur/
│   │   ├── murmur.go
│   │   ├── murmur_appengine.go
│   │   ├── murmur_test.go
│   │   └── murmur_unsafe.go
│   ├── streams/
│   │   ├── streams.go
│   │   └── streams_test.go
│   └── tests/
│       ├── common.go
│       ├── err_equal.go
│       ├── mock/
│       │   └── mock_framer.go
│       ├── rand.go
│       └── serialization/
│           ├── mod/
│           │   ├── all.go
│           │   ├── custom.go
│           │   ├── custom_refs.go
│           │   └── refs.go
│           ├── pointers.go
│           ├── pointers_test.go
│           ├── set_negative_marshal.go
│           ├── set_negative_unmarshal.go
│           ├── set_positive.go
│           ├── utils.go
│           ├── utils_equal.go
│           ├── utils_error.go
│           ├── utils_new.go
│           ├── utils_str.go
│           └── valcases/
│               ├── get.go
│               └── simple.go
├── keyspace_table_test.go
├── logger.go
├── lz4/
│   ├── go.mod
│   ├── go.sum
│   ├── lz4.go
│   ├── lz4_bench_test.go
│   └── lz4_test.go
├── marshal.go
├── marshal_test.go
├── metadata_scylla.go
├── metadata_scylla_test.go
├── policies.go
├── policies_bench_test.go
├── policies_integration_test.go
├── policies_test.go
├── prepared_cache.go
├── query_error_test.go
├── query_executor.go
├── recreate.go
├── recreate_test.go
├── renovate.json
├── ring_describer.go
├── ring_describer_test.go
├── schema_queries_test.go
├── scylla.go
├── scylla_cdc.go
├── scylla_shard_aware_port_common_test.go
├── scylla_shard_aware_port_integration_test.go
├── scylla_shard_aware_port_mocked_test.go
├── scylla_test.go
├── scylla_tokens_test.go
├── scyllacloud/
│   ├── cluster.go
│   ├── config.go
│   ├── config_test.go
│   ├── hostdialer.go
│   └── hostdialer_test.go
├── serialization/
│   ├── ascii/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── bigint/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── blob/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   ├── unmarshal_utils.go
│   │   └── unmarshal_utils_test.go
│   ├── boolean/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── counter/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── cqlint/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── cqltime/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── date/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── decimal/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   ├── unmarshal_ints.go
│   │   └── unmarshal_utils.go
│   ├── double/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── duration/
│   │   ├── duration.go
│   │   ├── marshal.go
│   │   ├── marshal_str.go
│   │   ├── marshal_str_test.go
│   │   ├── marshal_utils.go
│   │   ├── marshal_vint_test.go
│   │   ├── unmarshal.go
│   │   ├── unmarshal_str.go
│   │   ├── unmarshal_str_test.go
│   │   ├── unmarshal_utils.go
│   │   └── unmarshal_vint_test.go
│   ├── float/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── inet/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── smallint/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── text/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── timestamp/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── timeuuid/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── tinyint/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── uuid/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   ├── varchar/
│   │   ├── marshal.go
│   │   ├── marshal_utils.go
│   │   ├── unmarshal.go
│   │   └── unmarshal_utils.go
│   └── varint/
│       ├── marshal.go
│       ├── marshal_bigint_test.go
│       ├── marshal_custom.go
│       ├── marshal_ints.go
│       ├── marshal_uints.go
│       ├── marshal_utils.go
│       ├── unmarshal.go
│       ├── unmarshal_bigint_test.go
│       ├── unmarshal_custom.go
│       ├── unmarshal_ints.go
│       ├── unmarshal_uints.go
│       └── unmarshal_utils.go
├── session.go
├── session_connect_test.go
├── session_event_bus_integration_test.go
├── session_event_bus_test.go
├── session_test.go
├── session_unit_test.go
├── stress_test.go
├── tablet_integration_test.go
├── tablets/
│   ├── cow_tablet_list_test.go
│   ├── tabets_utils_test.go
│   ├── tablet_utils.go
│   ├── tablets.go
│   ├── tablets_bench_test.go
│   └── tablets_test.go
├── testdata/
│   ├── pki/
│   │   ├── ca.cnf
│   │   ├── cassandra.cnf
│   │   ├── generate_certs.sh
│   │   └── gocql.cnf
│   └── recreate/
│       ├── aggregates.cql
│       ├── aggregates_golden.cql
│       ├── index.cql
│       ├── index_golden.cql
│       ├── keyspace.cql
│       ├── keyspace_golden.cql
│       ├── materialized_views.cql
│       ├── materialized_views_golden.cql
│       ├── scylla_encryption_options_golden.json
│       ├── secondary_index.cql
│       ├── secondary_index_golden.cql
│       ├── table.cql
│       ├── table_golden.cql
│       ├── udt.cql
│       └── udt_golden.cql
├── tests/
│   ├── bench/
│   │   ├── bench_marshal_test.go
│   │   ├── bench_single_conn_test.go
│   │   ├── bench_vector_public_test.go
│   │   ├── go.mod
│   │   ├── go.sum
│   │   ├── rec_insert/
│   │   │   ├── 192.168.100.11:9042-0Reads
│   │   │   └── 192.168.100.11:9042-0Writes
│   │   └── rec_select/
│   │       ├── 192.168.100.11:9042-0Reads
│   │       └── 192.168.100.11:9042-0Writes
│   └── serialization/
│       ├── marshal_0_unset_test.go
│       ├── marshal_10_decimal_corrupt_test.go
│       ├── marshal_10_decimal_test.go
│       ├── marshal_11_texts_test.go
│       ├── marshal_12_ascii_corrupt_test.go
│       ├── marshal_12_ascii_test.go
│       ├── marshal_13_uuids_corrupt_test.go
│       ├── marshal_13_uuids_test.go
│       ├── marshal_14_inet_corrupt_test.go
│       ├── marshal_14_inet_test.go
│       ├── marshal_15_time_corrupt_test.go
│       ├── marshal_15_time_test.go
│       ├── marshal_16_timestamp_corrupt_test.go
│       ├── marshal_16_timestamp_test.go
│       ├── marshal_17_date_corrupt_test.go
│       ├── marshal_17_date_test.go
│       ├── marshal_18_duration_corrupt_test.go
│       ├── marshal_18_duration_test.go
│       ├── marshal_19_list_set_v3_corrupt_test.go
│       ├── marshal_19_list_set_v3_test.go
│       ├── marshal_1_boolean_corrupt_test.go
│       ├── marshal_1_boolean_test.go
│       ├── marshal_20_map_v3_corrupt_test.go
│       ├── marshal_20_map_v3_test.go
│       ├── marshal_2_tinyint_corrupt_test.go
│       ├── marshal_2_tinyint_test.go
│       ├── marshal_3_smallint_corrupt_test.go
│       ├── marshal_3_smallint_test.go
│       ├── marshal_4_int_corrupt_test.go
│       ├── marshal_4_int_test.go
│       ├── marshal_5_bigint_corrupt_test.go
│       ├── marshal_5_bigint_test.go
│       ├── marshal_6_counter_corrupt_test.go
│       ├── marshal_6_counter_test.go
│       ├── marshal_7_varint_corrupt_test.go
│       ├── marshal_7_varint_test.go
│       ├── marshal_8_float_corrupt_test.go
│       ├── marshal_8_float_test.go
│       ├── marshal_9_double_corrupt_test.go
│       └── marshal_9_duble_test.go
├── token.go
├── token_test.go
├── topology.go
├── topology_test.go
├── tracer.go
├── tracer_test.go
├── tuple_test.go
├── udt_test.go
├── uuid.go
├── uuid_test.go
├── vector_bench_test.go
├── vector_test.go
├── version.go
├── warning_handler.go
└── wiki_test.go
Download .txt
Showing preview only (365K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (4195 symbols across 316 files)

FILE: address_translators.go
  type AddressTranslator (line 32) | type AddressTranslator interface
  type AddressTranslatorFunc (line 39) | type AddressTranslatorFunc
    method Translate (line 41) | func (fn AddressTranslatorFunc) Translate(addr net.IP, port int) (net....
  function IdentityTranslator (line 46) | func IdentityTranslator() AddressTranslator {
  type AddressTranslatorHostInfo (line 52) | type AddressTranslatorHostInfo interface
  type AddressTranslatorV2 (line 73) | type AddressTranslatorV2 interface
  type AddressTranslatorFuncV2 (line 78) | type AddressTranslatorFuncV2
    method Translate (line 80) | func (fn AddressTranslatorFuncV2) Translate(addr net.IP, port int) (ne...
    method TranslateHost (line 88) | func (fn AddressTranslatorFuncV2) TranslateHost(host AddressTranslator...

FILE: address_translators_test.go
  function TestIdentityAddressTranslator_NilAddrAndZeroPort (line 37) | func TestIdentityAddressTranslator_NilAddrAndZeroPort(t *testing.T) {
  function TestIdentityAddressTranslator_HostProvided (line 53) | func TestIdentityAddressTranslator_HostProvided(t *testing.T) {
  function TestTranslateHostAddresses_NoScyllaPorts (line 69) | func TestTranslateHostAddresses_NoScyllaPorts(t *testing.T) {
  function TestTranslateHostAddresses_WithScyllaPorts (line 91) | func TestTranslateHostAddresses_WithScyllaPorts(t *testing.T) {

FILE: batch_test.go
  function TestBatch_Errors (line 36) | func TestBatch_Errors(t *testing.T) {
  function TestBatch_WithTimestamp (line 55) | func TestBatch_WithTimestamp(t *testing.T) {

FILE: callreq_wait.go
  function waitCallReqDone (line 5) | func waitCallReqDone(call *callReq, where string) {

FILE: callreq_wait_race.go
  function waitCallReqDone (line 10) | func waitCallReqDone(call *callReq, where string) {

FILE: cass1batch_test.go
  function TestProto1BatchInsert (line 36) | func TestProto1BatchInsert(t *testing.T) {
  function TestShouldPrepareFunction (line 58) | func TestShouldPrepareFunction(t *testing.T) {

FILE: cassandra_test.go
  function TestEmptyHosts (line 53) | func TestEmptyHosts(t *testing.T) {
  function TestInvalidPeerEntry (line 64) | func TestInvalidPeerEntry(t *testing.T) {
  function TestUseStatementError (line 103) | func TestUseStatementError(t *testing.T) {
  function TestInvalidKeyspace (line 119) | func TestInvalidKeyspace(t *testing.T) {
  function TestTracing (line 135) | func TestTracing(t *testing.T) {
  function TestObserve (line 180) | func TestObserve(t *testing.T) {
  function TestObserve_Pagination (line 277) | func TestObserve_Pagination(t *testing.T) {
  function TestPaging (line 333) | func TestPaging(t *testing.T) {
  function TestPagingWithAllowFiltering (line 364) | func TestPagingWithAllowFiltering(t *testing.T) {
  function TestPagingWithBind (line 501) | func TestPagingWithBind(t *testing.T) {
  function TestCAS (line 545) | func TestCAS(t *testing.T) {
  function TestConsistencySerial (line 726) | func TestConsistencySerial(t *testing.T) {
  function TestDurationType (line 816) | func TestDurationType(t *testing.T) {
  function TestMapScanCAS (line 872) | func TestMapScanCAS(t *testing.T) {
  function TestBatch (line 914) | func TestBatch(t *testing.T) {
  function TestUnpreparedBatch (line 943) | func TestUnpreparedBatch(t *testing.T) {
  function TestBatchLimit (line 982) | func TestBatchLimit(t *testing.T) {
  function TestWhereIn (line 1004) | func TestWhereIn(t *testing.T) {
  function TestTooManyQueryArgs (line 1034) | func TestTooManyQueryArgs(t *testing.T) {
  function TestNotEnoughQueryArgs (line 1066) | func TestNotEnoughQueryArgs(t *testing.T) {
  function TestCreateSessionTimeout (line 1095) | func TestCreateSessionTimeout(t *testing.T) {
  function TestReconnection (line 1123) | func TestReconnection(t *testing.T) {
  type FullName (line 1143) | type FullName struct
    method MarshalCQL (line 1148) | func (n FullName) MarshalCQL(info TypeInfo) ([]byte, error) {
    method UnmarshalCQL (line 1152) | func (n *FullName) UnmarshalCQL(info TypeInfo, data []byte) error {
  function TestMapScanWithRefMap (line 1158) | func TestMapScanWithRefMap(t *testing.T) {
  function TestMapScan (line 1228) | func TestMapScan(t *testing.T) {
  function TestSliceMap (line 1276) | func TestSliceMap(t *testing.T) {
  function matchSliceMap (line 1353) | func matchSliceMap(t *testing.T, sliceMap []map[string]any, testMap map[...
  type MyRetryPolicy (line 1403) | type MyRetryPolicy struct
    method Attempt (line 1406) | func (*MyRetryPolicy) Attempt(q RetryableQuery) bool {
    method GetRetryType (line 1413) | func (*MyRetryPolicy) GetRetryType(err error) RetryType {
  function Test_RetryPolicyIdempotence (line 1421) | func Test_RetryPolicyIdempotence(t *testing.T) {
  function TestSmallInt (line 1458) | func TestSmallInt(t *testing.T) {
  function TestScanWithNilArguments (line 1487) | func TestScanWithNilArguments(t *testing.T) {
  function TestScanCASWithNilArguments (line 1523) | func TestScanCASWithNilArguments(t *testing.T) {
  function TestRebindQueryInfo (line 1571) | func TestRebindQueryInfo(t *testing.T) {
  function TestStaticQueryInfo (line 1615) | func TestStaticQueryInfo(t *testing.T) {
  type ClusteredKeyValue (line 1660) | type ClusteredKeyValue struct
    method Bind (line 1666) | func (kv *ClusteredKeyValue) Bind(q *QueryInfo) ([]any, error) {
  function upcaseInitial (line 1679) | func upcaseInitial(str string) string {
  function TestBoundQueryInfo (line 1687) | func TestBoundQueryInfo(t *testing.T) {
  function TestBatchQueryInfo (line 1729) | func TestBatchQueryInfo(t *testing.T) {
  function getRandomConn (line 1781) | func getRandomConn(t *testing.T, session *Session) *Conn {
  function injectInvalidPreparedStatement (line 1789) | func injectInvalidPreparedStatement(t *testing.T, session *Session, tabl...
  function TestPrepare_MissingSchemaPrepare (line 1829) | func TestPrepare_MissingSchemaPrepare(t *testing.T) {
  function TestPrepare_ReprepareStatement (line 1855) | func TestPrepare_ReprepareStatement(t *testing.T) {
  function TestPrepare_ReprepareBatch (line 1873) | func TestPrepare_ReprepareBatch(t *testing.T) {
  function TestQueryInfo (line 1892) | func TestQueryInfo(t *testing.T) {
  function TestPrepare_PreparedCacheEviction (line 1915) | func TestPrepare_PreparedCacheEviction(t *testing.T) {
  function TestPrepare_PreparedCacheKey (line 2010) | func TestPrepare_PreparedCacheKey(t *testing.T) {
  function TestMarshalFloat64Ptr (line 2063) | func TestMarshalFloat64Ptr(t *testing.T) {
  function TestMarshalInet (line 2081) | func TestMarshalInet(t *testing.T) {
  function TestVarint (line 2136) | func TestVarint(t *testing.T) {
  function TestQueryStats (line 2249) | func TestQueryStats(t *testing.T) {
  function TestIterHost (line 2268) | func TestIterHost(t *testing.T) {
  function TestBatchStats (line 2282) | func TestBatchStats(t *testing.T) {
  type funcBatchObserver (line 2310) | type funcBatchObserver
    method ObserveBatch (line 2312) | func (f funcBatchObserver) ObserveBatch(ctx context.Context, o Observe...
  function TestBatchObserve (line 2316) | func TestBatchObserve(t *testing.T) {
  function TestNilInQuery (line 2381) | func TestNilInQuery(t *testing.T) {
  function TestEmptyTimestamp (line 2406) | func TestEmptyTimestamp(t *testing.T) {
  function TestGetKeyspaceMetadata (line 2435) | func TestGetKeyspaceMetadata(t *testing.T) {
  function TestSessionMetadataAPIs (line 2470) | func TestSessionMetadataAPIs(t *testing.T) {
  function tableNames (line 2810) | func tableNames(tables map[string]*TableMetadata) []string {
  function columnNames (line 2818) | func columnNames(columns map[string]*ColumnMetadata) []string {
  function TestGetKeyspaceMetadataFails (line 2827) | func TestGetKeyspaceMetadataFails(t *testing.T) {
  function TestRoutingKey (line 2841) | func TestRoutingKey(t *testing.T) {
  function TestTokenAwareConnPool (line 2974) | func TestTokenAwareConnPool(t *testing.T) {
  function TestNegativeStream (line 3025) | func TestNegativeStream(t *testing.T) {
  function TestManualQueryPaging (line 3047) | func TestManualQueryPaging(t *testing.T) {
  function TestSessionBindRoutingKey (line 3103) | func TestSessionBindRoutingKey(t *testing.T) {
  function TestJSONSupport (line 3138) | func TestJSONSupport(t *testing.T) {
  function TestUnmarshallNestedTypes (line 3186) | func TestUnmarshallNestedTypes(t *testing.T) {
  function TestSchemaReset (line 3223) | func TestSchemaReset(t *testing.T) {
  function TestCreateSession_DontSwallowError (line 3283) | func TestCreateSession_DontSwallowError(t *testing.T) {
  function TestControl_DiscoverProtocol (line 3309) | func TestControl_DiscoverProtocol(t *testing.T) {
  function TestUnsetCol (line 3327) | func TestUnsetCol(t *testing.T) {
  function TestUnsetColBatch (line 3360) | func TestUnsetColBatch(t *testing.T) {
  function TestQuery_NamedValues (line 3406) | func TestQuery_NamedValues(t *testing.T) {
  function TestQuery_SetHostID (line 3433) | func TestQuery_SetHostID(t *testing.T) {

FILE: ci/clean-old-temporary-docker-images.py
  function get_docker_token (line 9) | def get_docker_token(username, password):
  function get_repo_tags (line 21) | def get_repo_tags(token):
  function delete_tag (line 30) | def delete_tag(tag, token):
  function clean_old_images (line 40) | def clean_old_images():

FILE: client_routes.go
  type ClientRoutesEndpoint (line 18) | type ClientRoutesEndpoint struct
    method Validate (line 27) | func (e ClientRoutesEndpoint) Validate() error {
  type ClientRoutesEndpointList (line 34) | type ClientRoutesEndpointList
    method GetAllConnectionIDs (line 36) | func (l *ClientRoutesEndpointList) GetAllConnectionIDs() []string {
    method GetConnectionAddr (line 44) | func (l *ClientRoutesEndpointList) GetConnectionAddr(connectionID stri...
    method Validate (line 53) | func (l *ClientRoutesEndpointList) Validate() error {
  type ClientRoutesConfig (line 62) | type ClientRoutesConfig struct
    method Validate (line 93) | func (cfg *ClientRoutesConfig) Validate() error {
  type UnresolvedClientRoute (line 113) | type UnresolvedClientRoute struct
    method Similar (line 122) | func (r UnresolvedClientRoute) Similar(o UnresolvedClientRoute) bool {
    method Equal (line 127) | func (r UnresolvedClientRoute) Equal(o UnresolvedClientRoute) bool {
    method String (line 131) | func (r UnresolvedClientRoute) String() string {
  type UnresolvedClientRouteList (line 142) | type UnresolvedClientRouteList
    method Len (line 144) | func (l *UnresolvedClientRouteList) Len() int {
  type ResolvedClientRoute (line 148) | type ResolvedClientRoute struct
    method String (line 156) | func (r ResolvedClientRoute) String() string {
    method Clone (line 175) | func (r ResolvedClientRoute) Clone() ResolvedClientRoute {
    method Newer (line 191) | func (r ResolvedClientRoute) Newer(o ResolvedClientRoute) bool {
    method Similar (line 202) | func (r ResolvedClientRoute) Similar(o ResolvedClientRoute) bool {
    method NeedsUpdate (line 206) | func (r ResolvedClientRoute) NeedsUpdate() bool {
    method GetCQLPort (line 210) | func (r ResolvedClientRoute) GetCQLPort() uint16 {
  type ResolvedClientRouteList (line 217) | type ResolvedClientRouteList
    method Len (line 219) | func (l *ResolvedClientRouteList) Len() int {
    method MergeWithUnresolved (line 223) | func (l *ResolvedClientRouteList) MergeWithUnresolved(unresolved Unres...
    method MergeWithResolved (line 251) | func (l *ResolvedClientRouteList) MergeWithResolved(o *ResolvedClientR...
    method UpdateIfNewer (line 270) | func (l *ResolvedClientRouteList) UpdateIfNewer(route ResolvedClientRo...
    method FindByHostID (line 284) | func (l *ResolvedClientRouteList) FindByHostID(hostID string) *Resolve...
    method Clone (line 293) | func (l *ResolvedClientRouteList) Clone() ResolvedClientRouteList {
  type ResolvedEndpoint (line 302) | type ResolvedEndpoint struct
  type ClientRoutesResolver (line 313) | type ClientRoutesResolver interface
  type resolvedCacheRecord (line 317) | type resolvedCacheRecord struct
    method WasResolvedLessThan (line 322) | func (r resolvedCacheRecord) WasResolvedLessThan(cachingTime time.Dura...
  type simpleClientRoutesResolver (line 328) | type simpleClientRoutesResolver struct
    method Resolve (line 346) | func (r *simpleClientRoutesResolver) Resolve(endpoint ResolvedClientRo...
  function newSimpleClientRoutesResolver (line 335) | func newSimpleClientRoutesResolver(cachingTime time.Duration, resolver D...
  type ClientRoutesHandler (line 383) | type ClientRoutesHandler struct
    method Translate (line 400) | func (p *ClientRoutesHandler) Translate(addr net.IP, port int) (net.IP...
    method TranslateHost (line 412) | func (p *ClientRoutesHandler) TranslateHost(host AddressTranslatorHost...
    method Initialize (line 481) | func (p *ClientRoutesHandler) Initialize(s *Session) error {
    method Stop (line 509) | func (p *ClientRoutesHandler) Stop() {
    method resolveAndUpdateInPlace (line 528) | func (p *ClientRoutesHandler) resolveAndUpdateInPlace(records Resolved...
    method updateHostPortMappingAsync (line 590) | func (p *ClientRoutesHandler) updateHostPortMappingAsync(connectionIDs...
    method updateHostPortMappingSync (line 597) | func (p *ClientRoutesHandler) updateHostPortMappingSync(connectionIDs ...
    method startReadingEvents (line 607) | func (p *ClientRoutesHandler) startReadingEvents() {
    method startUpdateWorker (line 645) | func (p *ClientRoutesHandler) startUpdateWorker() {
    method updateHostPortMapping (line 662) | func (p *ClientRoutesHandler) updateHostPortMapping(connectionIDs []st...
  function pickProperPort (line 404) | func pickProperPort(pickTLSPorts bool, rec *ResolvedClientRoute) uint16 {
  type updateTask (line 475) | type updateTask struct
  function NewClientRoutesAddressTranslator (line 691) | func NewClientRoutesAddressTranslator(
  function getHostPortMappingFromCluster (line 711) | func getHostPortMappingFromCluster(c controlConnection, table string, co...

FILE: client_routes_test.go
  function TestGetHostPortMapping (line 15) | func TestGetHostPortMapping(t *testing.T) {
  function sortUnresolvedHostPorts (line 140) | func sortUnresolvedHostPorts(xs []UnresolvedClientRoute) {

FILE: client_routes_unit_test.go
  type dnsResolverFunc (line 15) | type dnsResolverFunc
    method LookupIP (line 18) | func (f dnsResolverFunc) LookupIP(host string) ([]net.IP, error) { ret...
  type clientRoutesResolverFunc (line 20) | type clientRoutesResolverFunc
    method Resolve (line 22) | func (f clientRoutesResolverFunc) Resolve(endpoint ResolvedClientRoute...
  type fakeControlConn (line 26) | type fakeControlConn struct
    method getConn (line 31) | func (f *fakeControlConn) getConn() *connHost          { return nil }
    method awaitSchemaAgreement (line 32) | func (f *fakeControlConn) awaitSchemaAgreement() error { return nil }
    method query (line 33) | func (f *fakeControlConn) query(statement string, values ...any) *Iter {
    method querySystem (line 38) | func (f *fakeControlConn) querySystem(statement string, values ...any)...
    method discoverProtocol (line 41) | func (f *fakeControlConn) discoverProtocol(hosts []*HostInfo) (int, er...
    method connect (line 42) | func (f *fakeControlConn) connect(hosts []*HostInfo) error            ...
    method close (line 43) | func (f *fakeControlConn) close()                                     ...
    method getSession (line 44) | func (f *fakeControlConn) getSession() *Session                       ...
    method reconnect (line 45) | func (f *fakeControlConn) reconnect() error                           ...
  type testHostInfo (line 47) | type testHostInfo struct
    method HostID (line 51) | func (t testHostInfo) HostID() string                     { return t.h...
    method Rack (line 52) | func (t testHostInfo) Rack() string                       { return "" }
    method DataCenter (line 53) | func (t testHostInfo) DataCenter() string                 { return "" }
    method BroadcastAddress (line 54) | func (t testHostInfo) BroadcastAddress() net.IP           { return nil }
    method ListenAddress (line 55) | func (t testHostInfo) ListenAddress() net.IP              { return nil }
    method RPCAddress (line 56) | func (t testHostInfo) RPCAddress() net.IP                 { return nil }
    method PreferredIP (line 57) | func (t testHostInfo) PreferredIP() net.IP                { return nil }
    method Peer (line 58) | func (t testHostInfo) Peer() net.IP                       { return nil }
    method UntranslatedConnectAddress (line 59) | func (t testHostInfo) UntranslatedConnectAddress() net.IP { return nil }
    method Port (line 60) | func (t testHostInfo) Port() int                          { return 0 }
    method Partitioner (line 61) | func (t testHostInfo) Partitioner() string                { return "" }
    method ClusterName (line 62) | func (t testHostInfo) ClusterName() string                { return "" }
    method ScyllaShardAwarePort (line 63) | func (t testHostInfo) ScyllaShardAwarePort() uint16       { return 0 }
    method ScyllaShardAwarePortTLS (line 64) | func (t testHostInfo) ScyllaShardAwarePortTLS() uint16    { return 0 }
    method ScyllaShardCount (line 65) | func (t testHostInfo) ScyllaShardCount() int              { return 0 }
  function TestResolvedClientRouteCloneNewerNeedsUpdate (line 67) | func TestResolvedClientRouteCloneNewerNeedsUpdate(t *testing.T) {
  function TestResolvedClientRouteListMergeWithUnresolved (line 117) | func TestResolvedClientRouteListMergeWithUnresolved(t *testing.T) {
  function TestResolvedClientRouteListMergeWithResolved (line 168) | func TestResolvedClientRouteListMergeWithResolved(t *testing.T) {
  function TestResolvedClientRouteListUpdateIfNewerAndFindByHostID (line 198) | func TestResolvedClientRouteListUpdateIfNewerAndFindByHostID(t *testing....
  function TestSimpleClientRoutesResolverResolve (line 224) | func TestSimpleClientRoutesResolverResolve(t *testing.T) {
  function TestClientRoutesHandlerTranslateHost (line 283) | func TestClientRoutesHandlerTranslateHost(t *testing.T) {
  function TestClientRoutesHandlerTranslateHost_CASCollision (line 343) | func TestClientRoutesHandlerTranslateHost_CASCollision(t *testing.T) {
  function TestClientRoutesHandlerResolveAndUpdateInPlace (line 381) | func TestClientRoutesHandlerResolveAndUpdateInPlace(t *testing.T) {
  function TestGetHostPortMappingFromClusterQuery (line 473) | func TestGetHostPortMappingFromClusterQuery(t *testing.T) {

FILE: cloud_cluster_test.go
  function TestCloudConnection (line 25) | func TestCloudConnection(t *testing.T) {
  function writeYamlToTempFile (line 171) | func writeYamlToTempFile(obj any) (string, error) {
  type dialerContextFunc (line 191) | type dialerContextFunc
    method DialContext (line 193) | func (d dialerContextFunc) DialContext(ctx context.Context, network, a...
  type sniProxy (line 197) | type sniProxy struct
    method Run (line 207) | func (p *sniProxy) Run(ctx context.Context) (string, error) {
    method handleConnection (line 231) | func (p *sniProxy) handleConnection(conn net.Conn) {
    method Close (line 284) | func (p *sniProxy) Close() error {
    method GetEvents (line 288) | func (p *sniProxy) GetEvents() []string {
  type readOnlyConn (line 298) | type readOnlyConn struct
    method Read (line 304) | func (conn readOnlyConn) Read(p []byte) (int, error)         { return ...
    method Write (line 305) | func (conn readOnlyConn) Write(p []byte) (int, error)        { return ...
    method Close (line 306) | func (conn readOnlyConn) Close() error                       { return ...
    method LocalAddr (line 307) | func (conn readOnlyConn) LocalAddr() net.Addr                { return ...
    method RemoteAddr (line 308) | func (conn readOnlyConn) RemoteAddr() net.Addr               { return ...
    method SetDeadline (line 309) | func (conn readOnlyConn) SetDeadline(t time.Time) error      { return ...
    method SetReadDeadline (line 310) | func (conn readOnlyConn) SetReadDeadline(t time.Time) error  { return ...
    method SetWriteDeadline (line 311) | func (conn readOnlyConn) SetWriteDeadline(t time.Time) error { return ...

FILE: cluster.go
  constant defaultDriverName (line 41) | defaultDriverName = "ScyllaDB GoCQL Driver"
  type PoolConfig (line 46) | type PoolConfig struct
    method buildPool (line 54) | func (p PoolConfig) buildPool(session *Session) *policyConnPool {
  type ClusterConfig (line 62) | type ClusterConfig struct
    method logger (line 408) | func (cfg *ClusterConfig) logger() StdLogger {
    method CreateSession (line 417) | func (cfg *ClusterConfig) CreateSession() (*Session, error) {
    method CreateSessionNonBlocking (line 421) | func (cfg *ClusterConfig) CreateSessionNonBlocking() (*Session, error) {
    method filterHost (line 425) | func (cfg *ClusterConfig) filterHost(host *HostInfo) bool {
    method ValidateAndInitSSL (line 429) | func (cfg *ClusterConfig) ValidateAndInitSSL() error {
    method getActualTLSConfig (line 442) | func (cfg *ClusterConfig) getActualTLSConfig() *tls.Config {
    method WithOptions (line 452) | func (cfg *ClusterConfig) WithOptions(opts ...ClusterOption) *ClusterC...
    method Validate (line 509) | func (cfg *ClusterConfig) Validate() error {
  type DNSResolver (line 290) | type DNSResolver interface
  type ApplicationInfo (line 294) | type ApplicationInfo interface
  type StaticApplicationInfo (line 298) | type StaticApplicationInfo struct
    method UpdateStartupOptions (line 312) | func (i *StaticApplicationInfo) UpdateStartupOptions(opts map[string]s...
  function NewStaticApplicationInfo (line 304) | func NewStaticApplicationInfo(name, version, clientID string) *StaticApp...
  type SimpleDNSResolver (line 324) | type SimpleDNSResolver struct
    method LookupIP (line 334) | func (r SimpleDNSResolver) LookupIP(host string) ([]net.IP, error) {
  function NewSimpleDNSResolver (line 328) | func NewSimpleDNSResolver(hostLookupPreferV4 bool) *SimpleDNSResolver {
  type Dialer (line 356) | type Dialer interface
  function NewCluster (line 369) | func NewCluster(hosts ...string) *ClusterConfig {
  type ClusterOption (line 450) | type ClusterOption
  type ClientRoutesOption (line 459) | type ClientRoutesOption
  function WithMaxResolverConcurrency (line 461) | func WithMaxResolverConcurrency(val int) func(*ClientRoutesConfig) {
  function WithResolveHealthyEndpointPeriod (line 467) | func WithResolveHealthyEndpointPeriod(val time.Duration) func(*ClientRou...
  function WithEndpoints (line 473) | func WithEndpoints(endpoints ...ClientRoutesEndpoint) func(*ClientRoutes...
  function WithTable (line 479) | func WithTable(tableName string) func(*ClientRoutesConfig) {
  function WithClientRoutes (line 485) | func WithClientRoutes(opts ...ClientRoutesOption) func(*ClusterConfig) {
  function setupTLSConfig (line 628) | func setupTLSConfig(sslOpts *SslOptions) (*tls.Config, error) {

FILE: cluster_test.go
  function TestNewCluster_Defaults (line 39) | func TestNewCluster_Defaults(t *testing.T) {
  function TestNewCluster_WithHosts (line 60) | func TestNewCluster_WithHosts(t *testing.T) {
  function TestClusterConfig_translateAddressAndPort_NilTranslator (line 69) | func TestClusterConfig_translateAddressAndPort_NilTranslator(t *testing....
  function TestClusterConfig_translateAddressAndPort_EmptyAddr (line 84) | func TestClusterConfig_translateAddressAndPort_EmptyAddr(t *testing.T) {
  function TestClusterConfig_translateAddressAndPort_Success (line 101) | func TestClusterConfig_translateAddressAndPort_Success(t *testing.T) {

FILE: common_test.go
  function init (line 61) | func init() {
  function TestMain (line 67) | func TestMain(m *testing.M) {
  function getClusterHosts (line 75) | func getClusterHosts() []string {
  function addSslOptions (line 79) | func addSslOptions(cluster *ClusterConfig) *ClusterConfig {
  type OnceManager (line 96) | type OnceManager struct
    method GetOnce (line 107) | func (o *OnceManager) GetOnce(key string) *sync.Once {
  function NewOnceManager (line 101) | func NewOnceManager() *OnceManager {
  function isTabletsSupported (line 123) | func isTabletsSupported() bool {
  function probeTabletsSupported (line 131) | func probeTabletsSupported() {
  function isTabletsAutoEnabled (line 160) | func isTabletsAutoEnabled() bool {
  function probeTabletsAutoEnabled (line 168) | func probeTabletsAutoEnabled() {
  function initTabletProbes (line 203) | func initTabletProbes() {
  function createTable (line 210) | func createTable(s *Session, table string) error {
  function createTables (line 243) | func createTables(s *Session, ddls ...string) error {
  function extractKeyspaceTableFromDDL (line 275) | func extractKeyspaceTableFromDDL(ddl string) (keyspace, table string) {
  function createCluster (line 304) | func createCluster(opts ...func(*ClusterConfig)) *ClusterConfig {
  function createKeyspace (line 333) | func createKeyspace(tb testing.TB, cluster *ClusterConfig, keyspace stri...
  type testKeyspaceOpts (line 375) | type testKeyspaceOpts struct
    method KeyspaceName (line 379) | func (o *testKeyspaceOpts) KeyspaceName() string {
  function createSessionFromClusterHelper (line 386) | func createSessionFromClusterHelper(cluster *ClusterConfig, tb testing.T...
  function getClusterSocketFile (line 406) | func getClusterSocketFile() []string {
  function createSessionFromClusterTabletsDisabled (line 416) | func createSessionFromClusterTabletsDisabled(cluster *ClusterConfig, tb ...
  function createSessionFromCluster (line 420) | func createSessionFromCluster(cluster *ClusterConfig, tb testing.TB) *Se...
  function createSession (line 424) | func createSession(tb testing.TB, opts ...func(config *ClusterConfig)) *...
  function createViews (line 429) | func createViews(t *testing.T, session *Session) {
  function createMaterializedViews (line 440) | func createMaterializedViews(t *testing.T, session *Session) {
  function createFunctions (line 478) | func createFunctions(t *testing.T, session *Session) {
  function createAggregate (line 500) | func createAggregate(t *testing.T, session *Session) {
  constant maxCQLIdentifierLen (line 526) | maxCQLIdentifierLen = 48
  constant testTableNameHashLen (line 527) | testTableNameHashLen = 16
  function testTableName (line 532) | func testTableName(t testing.TB, parts ...string) string {
  function testTypeName (line 565) | func testTypeName(t testing.TB, parts ...string) string {
  function testKeyspaceName (line 571) | func testKeyspaceName(t testing.TB, parts ...string) string {
  function staticAddressTranslator (line 575) | func staticAddressTranslator(newAddr net.IP, newPort int) AddressTransla...

FILE: compressor.go
  type Compressor (line 31) | type Compressor interface
  type SnappyCompressor (line 41) | type SnappyCompressor struct
    method Name (line 43) | func (s SnappyCompressor) Name() string {
    method Encode (line 47) | func (s SnappyCompressor) Encode(data []byte) ([]byte, error) {
    method Decode (line 51) | func (s SnappyCompressor) Decode(data []byte) ([]byte, error) {

FILE: compressor_test.go
  type frameExample (line 40) | type frameExample struct
  function TestSnappyCompressor (line 88) | func TestSnappyCompressor(t *testing.T) {
  function BenchmarkSnappyCompressor (line 167) | func BenchmarkSnappyCompressor(b *testing.B) {
  function init (line 190) | func init() {

FILE: conn.go
  function approve (line 50) | func approve(authenticator string, approvedAuthenticators []string) bool {
  type Authenticator (line 62) | type Authenticator interface
  type WarningHandlerBuilder (line 67) | type WarningHandlerBuilder
  type WarningHandler (line 69) | type WarningHandler interface
  type PasswordAuthenticator (line 76) | type PasswordAuthenticator struct
    method Challenge (line 85) | func (p PasswordAuthenticator) Challenge(req []byte) ([]byte, Authenti...
    method Success (line 97) | func (p PasswordAuthenticator) Success(data []byte) error {
  type SslOptions (line 114) | type SslOptions struct
  type ConnConfig (line 132) | type ConnConfig struct
    method logger (line 149) | func (c *ConnConfig) logger() StdLogger {
  type ConnErrorHandler (line 156) | type ConnErrorHandler interface
  type connErrorHandlerFn (line 160) | type connErrorHandlerFn
    method HandleError (line 162) | func (fn connErrorHandlerFn) HandleError(conn *Conn, err error, closed...
  type ConnInterface (line 166) | type ConnInterface interface
  type Conn (line 180) | type Conn struct
    method getIsSchemaV2 (line 221) | func (c *Conn) getIsSchemaV2() bool {
    method setSchemaV2 (line 225) | func (c *Conn) setSchemaV2(s bool) {
    method setSystemRequestTimeout (line 229) | func (c *Conn) setSystemRequestTimeout(t time.Duration) {
    method recalculateSystemRequestTimeout (line 234) | func (c *Conn) recalculateSystemRequestTimeout() {
    method finalizeConnection (line 240) | func (c *Conn) finalizeConnection() {
    method getScyllaSupported (line 250) | func (c *Conn) getScyllaSupported() ScyllaConnectionFeatures {
    method init (line 414) | func (c *Conn) init(ctx context.Context, dialedHost *DialedHost) error {
    method Write (line 453) | func (c *Conn) Write(p []byte) (n int, err error) {
    method Read (line 457) | func (c *Conn) Read(p []byte) (n int, err error) {
    method closeWithError (line 680) | func (c *Conn) closeWithError(err error) {
    method isTabletSupported (line 744) | func (c *Conn) isTabletSupported() bool {
    method setTabletSupported (line 748) | func (c *Conn) setTabletSupported(val bool) {
    method close (line 756) | func (c *Conn) close() error {
    method Close (line 760) | func (c *Conn) Close() {
    method serve (line 767) | func (c *Conn) serve(ctx context.Context) {
    method discardFrame (line 776) | func (c *Conn) discardFrame(head frm.FrameHeader) error {
    method heartBeat (line 795) | func (c *Conn) heartBeat(ctx context.Context) {
    method recv (line 843) | func (c *Conn) recv(ctx context.Context) error {
    method readFrameIntoFramer (line 953) | func (c *Conn) readFrameIntoFramer(head frm.FrameHeader) (*framer, err...
    method abandonRecvCall (line 962) | func (c *Conn) abandonRecvCall(call *callReq, framer *framer) {
    method releaseStream (line 969) | func (c *Conn) releaseStream(call *callReq) {
    method removeCallIfOpen (line 1041) | func (c *Conn) removeCallIfOpen(streamID int) bool {
    method addCall (line 1291) | func (c *Conn) addCall(call *callReq) error {
    method exec (line 1315) | func (c *Conn) exec(ctx context.Context, req frameBuilder, tracer Trac...
    method prepareStatement (line 1549) | func (c *Conn) prepareStatement(ctx context.Context, stmt string, trac...
    method executeQuery (line 1641) | func (c *Conn) executeQuery(ctx context.Context, qry *Query) (iter *It...
    method Pick (line 1812) | func (c *Conn) Pick(qry *Query) *Conn {
    method Closed (line 1819) | func (c *Conn) Closed() bool {
    method Address (line 1825) | func (c *Conn) Address() string {
    method AvailableStreams (line 1829) | func (c *Conn) AvailableStreams() int {
    method UseKeyspace (line 1837) | func (c *Conn) UseKeyspace(keyspace string) error {
    method executeBatch (line 1865) | func (c *Conn) executeBatch(ctx context.Context, batch *Batch) (iter *...
    method querySystem (line 1983) | func (c *Conn) querySystem(ctx context.Context, query string, values ....
    method awaitSchemaAgreement (line 2038) | func (c *Conn) awaitSchemaAgreement(ctx context.Context) error {
  method connect (line 256) | func (s *Session) connect(ctx context.Context, host *HostInfo, errorHand...
  method connectShard (line 263) | func (s *Session) connectShard(ctx context.Context, host *HostInfo, erro...
  method dial (line 270) | func (s *Session) dial(ctx context.Context, host *HostInfo, connConfig *...
  function translateHostAddresses (line 274) | func translateHostAddresses(addressTranslator AddressTranslator, host *H...
  method dialShard (line 315) | func (s *Session) dialShard(ctx context.Context, host *HostInfo, connCon...
  method dialWithoutObserver (line 349) | func (s *Session) dialWithoutObserver(ctx context.Context, host *HostInf...
  method streamIDGenerator (line 407) | func (s *Session) streamIDGenerator() *streams.IDGenerator {
  type startupCoordinator (line 484) | type startupCoordinator struct
    method setupConn (line 489) | func (s *startupCoordinator) setupConn(ctx context.Context) error {
    method write (line 543) | func (s *startupCoordinator) write(ctx context.Context, frame frameBui...
    method options (line 559) | func (s *startupCoordinator) options(ctx context.Context) error {
    method startup (line 590) | func (s *startupCoordinator) startup(ctx context.Context) error {
    method authenticateHandshake (line 640) | func (s *startupCoordinator) authenticateHandshake(ctx context.Context...
  type protocolError (line 784) | type protocolError struct
    method Error (line 788) | func (p *protocolError) Error() string {
  type callReq (line 981) | type callReq struct
    method finishExec (line 1030) | func (call *callReq) finishExec() {
    method waitExecDone (line 1034) | func (call *callReq) waitExecDone(where string) {
  function getCallReq (line 1003) | func getCallReq(streamID int) *callReq {
  function putCallReq (line 1014) | func putCallReq(call *callReq) {
  type callResp (line 1053) | type callResp struct
  type contextWriter (line 1062) | type contextWriter interface
  type deadlineWriter (line 1077) | type deadlineWriter interface
  type deadlineContextWriter (line 1082) | type deadlineContextWriter struct
    method setWriteTimeout (line 1092) | func (c *deadlineContextWriter) setWriteTimeout(timeout time.Duration) {
    method writeContext (line 1097) | func (c *deadlineContextWriter) writeContext(ctx context.Context, p []...
  function newWriteCoalescer (line 1122) | func newWriteCoalescer(conn deadlineWriter, writeTimeout, coalesceDurati...
  type writeCoalescer (line 1134) | type writeCoalescer struct
    method setWriteTimeout (line 1144) | func (w *writeCoalescer) setWriteTimeout(timeout time.Duration) {
    method writeContext (line 1171) | func (w *writeCoalescer) writeContext(ctx context.Context, p []byte) (...
    method writeFlusher (line 1198) | func (w *writeCoalescer) writeFlusher(interval time.Duration) {
    method writeFlusherImpl (line 1209) | func (w *writeCoalescer) writeFlusherImpl(timerC <-chan time.Time, res...
    method flush (line 1248) | func (w *writeCoalescer) flush(resultChans []chan<- writeResult, buffe...
  type writeRequest (line 1148) | type writeRequest struct
  type writeResult (line 1155) | type writeResult struct
  type ObservedStream (line 1491) | type ObservedStream struct
  type StreamObserver (line 1501) | type StreamObserver interface
  type StreamObserverContext (line 1522) | type StreamObserverContext interface
  type preparedStatment (line 1536) | type preparedStatment struct
  type inflightPrepare (line 1542) | type inflightPrepare struct
  function marshalQueryValue (line 1621) | func marshalQueryValue(typ TypeInfo, value any, dst *queryValues) error {
  function useKeyspaceStmt (line 1833) | func useKeyspaceStmt(keyspace string) string {
  constant qrySystemPeers (line 1993) | qrySystemPeers = "SELECT * FROM system.peers"
  constant qrySystemPeersV2 (line 1994) | qrySystemPeersV2 = "SELECT * FROM system.peers_v2"
  constant qrySystemLocal (line 1996) | qrySystemLocal = "SELECT * FROM system.local WHERE key='local'"
  function getSchemaAgreement (line 1998) | func getSchemaAgreement(queryLocalSchemasRows []string, querySystemPeers...
  type schemaAgreementHost (line 2026) | type schemaAgreementHost struct
    method IsValid (line 2034) | func (h *schemaAgreementHost) IsValid() bool {
  type ErrSchemaMismatch (line 2113) | type ErrSchemaMismatch struct
    method Error (line 2117) | func (e *ErrSchemaMismatch) Error() string {
  type QueryError (line 2121) | type QueryError struct
    method IsIdempotent (line 2129) | func (e *QueryError) IsIdempotent() bool {
    method PotentiallyExecuted (line 2133) | func (e *QueryError) PotentiallyExecuted() bool {
    method Error (line 2137) | func (e *QueryError) Error() string {
    method Unwrap (line 2144) | func (e *QueryError) Unwrap() error {
  function unmarshalTabletHint (line 2148) | func unmarshalTabletHint(hint []byte, v uint8, keyspace, table string) (...

FILE: conn_test.go
  constant defaultProto (line 58) | defaultProto = protoVersion3
  type brokenDNSResolver (line 61) | type brokenDNSResolver struct
    method LookupIP (line 63) | func (b brokenDNSResolver) LookupIP(host string) ([]net.IP, error) {
  function TestApprove (line 72) | func TestApprove(t *testing.T) {
  function testCluster (line 97) | func testCluster(proto frm.ProtoVersion, addresses ...string) *ClusterCo...
  function TestSimple (line 105) | func TestSimple(t *testing.T) {
  function TestSSLSimple (line 120) | func TestSSLSimple(t *testing.T) {
  function TestSSLSimpleNoClientCert (line 134) | func TestSSLSimpleNoClientCert(t *testing.T) {
  function createTestSslCluster (line 148) | func createTestSslCluster(addr string, proto frm.ProtoVersion, useClient...
  function TestClosed (line 164) | func TestClosed(t *testing.T) {
  function newTestSession (line 182) | func newTestSession(proto frm.ProtoVersion, addresses ...string) (*Sessi...
  function TestDNSLookupConnected (line 188) | func TestDNSLookupConnected(t *testing.T) {
  function TestDNSLookupError (line 214) | func TestDNSLookupError(t *testing.T) {
  function TestStartupTimeout (line 249) | func TestStartupTimeout(t *testing.T) {
  function TestTimeout (line 291) | func TestTimeout(t *testing.T) {
  function TestCancel (line 324) | func TestCancel(t *testing.T) {
  type testQueryObserver (line 358) | type testQueryObserver struct
    method ObserveQuery (line 364) | func (o *testQueryObserver) ObserveQuery(ctx context.Context, q Observ...
    method GetMetrics (line 373) | func (o *testQueryObserver) GetMetrics(host *HostInfo) *hostMetrics {
  function TestQueryRetry (line 379) | func TestQueryRetry(t *testing.T) {
  function TestQueryMultinodeWithMetrics (line 420) | func TestQueryMultinodeWithMetrics(t *testing.T) {
  type testRetryPolicy (line 494) | type testRetryPolicy struct
    method Attempt (line 498) | func (t *testRetryPolicy) Attempt(qry RetryableQuery) bool {
    method GetRetryType (line 501) | func (t *testRetryPolicy) GetRetryType(err error) RetryType {
  function TestSpeculativeExecution (line 509) | func TestSpeculativeExecution(t *testing.T) {
  function TestPolicyConnPoolSSL (line 570) | func TestPolicyConnPoolSSL(t *testing.T) {
  function TestQueryTimeout (line 595) | func TestQueryTimeout(t *testing.T) {
  function BenchmarkSingleConn (line 632) | func BenchmarkSingleConn(b *testing.B) {
  function TestQueryTimeoutReuseStream (line 659) | func TestQueryTimeoutReuseStream(t *testing.T) {
  function TestQueryTimeoutClose (line 687) | func TestQueryTimeoutClose(t *testing.T) {
  function TestStream0 (line 722) | func TestStream0(t *testing.T) {
  function TestContext_Timeout (line 753) | func TestContext_Timeout(t *testing.T) {
  type TestReconnectionPolicy (line 777) | type TestReconnectionPolicy struct
    method GetInterval (line 782) | func (c *TestReconnectionPolicy) GetInterval(currentRetry int) time.Du...
    method GetMaxRetries (line 787) | func (c *TestReconnectionPolicy) GetMaxRetries() int {
  function TestInitialRetryPolicy (line 791) | func TestInitialRetryPolicy(t *testing.T) {
  function TestContext_CanceledBeforeExec (line 858) | func TestContext_CanceledBeforeExec(t *testing.T) {
  function TestCallReqReuseDoesNotInvalidateOutstandingTimeout (line 907) | func TestCallReqReuseDoesNotInvalidateOutstandingTimeout(t *testing.T) {
  type testContextWriter (line 934) | type testContextWriter struct
    method writeContext (line 940) | func (w testContextWriter) writeContext(ctx context.Context, p []byte)...
    method setWriteTimeout (line 950) | func (w testContextWriter) setWriteTimeout(timeout time.Duration) {}
  type contextWriterFunc (line 952) | type contextWriterFunc
    method writeContext (line 954) | func (fn contextWriterFunc) writeContext(ctx context.Context, p []byte...
    method setWriteTimeout (line 958) | func (fn contextWriterFunc) setWriteTimeout(timeout time.Duration) {}
  function newTestExecConn (line 960) | func newTestExecConn(t *testing.T, w contextWriter) (*Conn, net.Conn) {
  function waitForSingleCall (line 978) | func waitForSingleCall(t *testing.T, c *Conn) *callReq {
  function detachSingleCall (line 1001) | func detachSingleCall(t *testing.T, c *Conn) *callReq {
  type testStreamObserver (line 1015) | type testStreamObserver struct
    method StreamContext (line 1019) | func (o *testStreamObserver) StreamContext(context.Context) StreamObse...
  type testStreamObserverContext (line 1023) | type testStreamObserverContext struct
    method StreamStarted (line 1037) | func (o *testStreamObserverContext) StreamStarted(ObservedStream) {
    method StreamAbandoned (line 1044) | func (o *testStreamObserverContext) StreamAbandoned(ObservedStream) {
    method StreamFinished (line 1051) | func (o *testStreamObserverContext) StreamFinished(ObservedStream) {
  function newTestStreamObserverContext (line 1029) | func newTestStreamObserverContext() *testStreamObserverContext {
  function TestExecCloseWithError (line 1058) | func TestExecCloseWithError(t *testing.T) {
  function tcpConnPair (line 1385) | func tcpConnPair() (s, c net.Conn, err error) {
  function TestWriteCoalescing (line 1423) | func TestWriteCoalescing(t *testing.T) {
  function TestWriteCoalescing_WriteAfterClose (line 1499) | func TestWriteCoalescing_WriteAfterClose(t *testing.T) {
  function TestSkipMetadata (line 1540) | func TestSkipMetadata(t *testing.T) {
  function TestPrepareBatchMetadataMultipleKeyspaceTables (line 1565) | func TestPrepareBatchMetadataMultipleKeyspaceTables(t *testing.T) {
  type recordingFrameHeaderObserver (line 1609) | type recordingFrameHeaderObserver struct
    method ObserveFrameHeader (line 1615) | func (r *recordingFrameHeaderObserver) ObserveFrameHeader(ctx context....
    method getFrames (line 1621) | func (r *recordingFrameHeaderObserver) getFrames() []ObservedFrameHead...
  function TestFrameHeaderObserver (line 1627) | func TestFrameHeaderObserver(t *testing.T) {
  function NewTestServerWithAddress (line 1662) | func NewTestServerWithAddress(addr string, t testing.TB, protocol uint8,...
  function NewTestServerWithAddressAndSupportedFactory (line 1669) | func NewTestServerWithAddressAndSupportedFactory(addr string, t testing....
  type newTestServerOpts (line 1677) | type newTestServerOpts struct
    method newServer (line 1684) | func (nts newTestServerOpts) newServer(t testing.TB, ctx context.Conte...
  function NewTestServer (line 1717) | func NewTestServer(t testing.TB, protocol uint8, ctx context.Context) *T...
  function NewSSLTestServer (line 1721) | func NewSSLTestServer(t testing.TB, protocol uint8, ctx context.Context)...
  function NewSSLTestServerWithSupportedFactory (line 1725) | func NewSSLTestServerWithSupportedFactory(t testing.TB, protocol uint8, ...
  type TestServer (line 1764) | type TestServer struct
    method session (line 1786) | func (srv *TestServer) session() (*Session, error) {
    method host (line 1790) | func (srv *TestServer) host() *HostInfo {
    method closeWatch (line 1798) | func (srv *TestServer) closeWatch() {
    method serve (line 1807) | func (srv *TestServer) serve() {
    method isClosed (line 1842) | func (srv *TestServer) isClosed() bool {
    method closeLocked (line 1848) | func (srv *TestServer) closeLocked() {
    method Stop (line 1859) | func (srv *TestServer) Stop() {
    method errorLocked (line 1865) | func (srv *TestServer) errorLocked(err any) {
    method process (line 1874) | func (srv *TestServer) process(conn net.Conn, reqFrame *framer, exts m...
    method readFrame (line 2095) | func (srv *TestServer) readFrame(conn net.Conn) (*framer, error) {
  type testSupportedFactory (line 1784) | type testSupportedFactory
  function TestGetSchemaAgreement (line 2118) | func TestGetSchemaAgreement(t *testing.T) {
  function TestUseKeyspaceQuoteEscaping (line 2178) | func TestUseKeyspaceQuoteEscaping(t *testing.T) {
  function newTestConnWithFramerPool (line 2199) | func newTestConnWithFramerPool() *Conn {
  function buildTestFrame (line 2208) | func buildTestFrame(t *testing.T, f *framer, req frameBuilder, streamID ...
  function TestReleaseFramer (line 2224) | func TestReleaseFramer(t *testing.T) {

FILE: connectionpool.go
  type SetHosts (line 41) | type SetHosts interface
  type SetPartitioner (line 46) | type SetPartitioner interface
  type SetTablets (line 51) | type SetTablets interface
  type policyConnPool (line 55) | type policyConnPool struct
    method SetHosts (line 117) | func (p *policyConnPool) SetHosts(hosts []*HostInfo) {
    method InFlight (line 169) | func (p *policyConnPool) InFlight() int {
    method Size (line 180) | func (p *policyConnPool) Size() int {
    method getPool (line 191) | func (p *policyConnPool) getPool(host *HostInfo) (pool *hostConnPool, ...
    method getPoolByHostID (line 199) | func (p *policyConnPool) getPoolByHostID(hostID string) (pool *hostCon...
    method iteratePool (line 206) | func (p *policyConnPool) iteratePool(iter func(info HostPoolInfo) bool) {
    method Close (line 216) | func (p *policyConnPool) Close() {
    method addHost (line 227) | func (p *policyConnPool) addHost(host *HostInfo) {
    method removeHost (line 246) | func (p *policyConnPool) removeHost(hostID string) {
  function connConfig (line 64) | func connConfig(cfg *ClusterConfig) (*ConnConfig, error) {
  function newPolicyConnPool (line 104) | func newPolicyConnPool(session *Session) *policyConnPool {
  type hostConnPool (line 262) | type hostConnPool struct
    method String (line 276) | func (pool *hostConnPool) String() string {
    method Pick (line 302) | func (pool *hostConnPool) Pick(token Token, qry ExecutableQuery) *Conn {
    method Size (line 324) | func (pool *hostConnPool) Size() int {
    method InFlight (line 333) | func (pool *hostConnPool) InFlight() int {
    method Close (line 342) | func (pool *hostConnPool) Close() {
    method fill (line 355) | func (pool *hostConnPool) fill() {
    method fill_debounce (line 426) | func (pool *hostConnPool) fill_debounce() {
    method logConnectErr (line 430) | func (pool *hostConnPool) logConnectErr(err error) {
    method fillingStopped (line 444) | func (pool *hostConnPool) fillingStopped(err error) {
    method connectMany (line 475) | func (pool *hostConnPool) connectMany(count int) error {
    method connect (line 504) | func (pool *hostConnPool) connect() (err error) {
    method initConnPicker (line 569) | func (pool *hostConnPool) initConnPicker(conn *Conn) {
    method HandleError (line 583) | func (pool *hostConnPool) HandleError(conn *Conn, err error, closed bo...
    method GetConnectionCount (line 607) | func (pool *hostConnPool) GetConnectionCount() int {
    method GetExcessConnectionCount (line 613) | func (pool *hostConnPool) GetExcessConnectionCount() int {
    method GetShardCount (line 619) | func (pool *hostConnPool) GetShardCount() int {
    method Host (line 625) | func (pool *hostConnPool) Host() HostInformation {
    method IsClosed (line 629) | func (pool *hostConnPool) IsClosed() bool {
  function newHostConnPool (line 284) | func newHostConnPool(session *Session, host *HostInfo, size int, keyspac...

FILE: connectionpool_test.go
  function TestSetupTLSConfig (line 41) | func TestSetupTLSConfig(t *testing.T) {
  type errorConn (line 121) | type errorConn struct
    method Close (line 125) | func (e errorConn) Close() error {
  function TestHostConnPoolCloseDeadlock (line 136) | func TestHostConnPoolCloseDeadlock(t *testing.T) {
  function TestHostConnPoolConnectClosedPoolDoesNotDeadlock (line 190) | func TestHostConnPoolConnectClosedPoolDoesNotDeadlock(t *testing.T) {

FILE: connpicker.go
  type ConnPicker (line 9) | type ConnPicker interface
  type defaultConnPicker (line 27) | type defaultConnPicker struct
    method GetConnectionCount (line 34) | func (p *defaultConnPicker) GetConnectionCount() int {
    method GetExcessConnectionCount (line 40) | func (p *defaultConnPicker) GetExcessConnectionCount() int {
    method GetShardCount (line 44) | func (p *defaultConnPicker) GetShardCount() int {
    method Remove (line 58) | func (p *defaultConnPicker) Remove(conn *Conn) {
    method Close (line 71) | func (p *defaultConnPicker) Close() {
    method InFlight (line 84) | func (p *defaultConnPicker) InFlight() int {
    method Size (line 91) | func (p *defaultConnPicker) Size() (int, int) {
    method Pick (line 98) | func (p *defaultConnPicker) Pick(Token, ExecutableQuery) *Conn {
    method Put (line 125) | func (p *defaultConnPicker) Put(conn *Conn) error {
    method NextShard (line 132) | func (*defaultConnPicker) NextShard() (shardID, nrShards int) {
  function newDefaultConnPicker (line 49) | func newDefaultConnPicker(size int) *defaultConnPicker {
  type nopConnPicker (line 139) | type nopConnPicker struct
    method GetConnectionCount (line 141) | func (p nopConnPicker) GetConnectionCount() int {
    method GetExcessConnectionCount (line 145) | func (p nopConnPicker) GetExcessConnectionCount() int {
    method GetShardCount (line 149) | func (p nopConnPicker) GetShardCount() int {
    method Pick (line 153) | func (nopConnPicker) Pick(Token, ExecutableQuery) *Conn {
    method Put (line 157) | func (nopConnPicker) Put(*Conn) error {
    method Remove (line 161) | func (nopConnPicker) Remove(conn *Conn) {
    method InFlight (line 164) | func (nopConnPicker) InFlight() int {
    method Size (line 168) | func (nopConnPicker) Size() (int, int) {
    method Close (line 175) | func (nopConnPicker) Close() {
    method NextShard (line 178) | func (nopConnPicker) NextShard() (shardID, nrShards int) {

FILE: control.go
  function init (line 50) | func init() {
  constant controlConnStarting (line 60) | controlConnStarting = 0
  constant controlConnStarted (line 61) | controlConnStarted  = 1
  constant controlConnClosing (line 62) | controlConnClosing  = -1
  type controlConnection (line 65) | type controlConnection interface
  type controlConn (line 79) | type controlConn struct
    method getSession (line 88) | func (c *controlConn) getSession() *Session {
    method heartBeat (line 105) | func (c *controlConn) heartBeat() {
    method discoverProtocol (line 236) | func (c *controlConn) discoverProtocol(hosts []*HostInfo) (int, error) {
    method connect (line 271) | func (c *controlConn) connect(hosts []*HostInfo) error {
    method setupConn (line 317) | func (c *controlConn) setupConn(conn *Conn) error {
    method registerEvents (line 364) | func (c *controlConn) registerEvents(conn *Conn) error {
    method reconnect (line 403) | func (c *controlConn) reconnect() error {
    method attemptReconnect (line 431) | func (c *controlConn) attemptReconnect() error {
    method attemptReconnectToAnyOfHosts (line 465) | func (c *controlConn) attemptReconnectToAnyOfHosts(hosts []*HostInfo) ...
    method HandleError (line 494) | func (c *controlConn) HandleError(conn *Conn, err error, closed bool) {
    method getConn (line 510) | func (c *controlConn) getConn() *connHost {
    method writeFrame (line 523) | func (c *controlConn) writeFrame(w frameBuilder) (frame, error) {
    method querySystem (line 539) | func (c *controlConn) querySystem(statement string, values ...any) (it...
    method query (line 549) | func (c *controlConn) query(statement string, values ...any) (iter *It...
    method runQuery (line 554) | func (c *controlConn) runQuery(qry *Query) (iter *Iter) {
    method awaitSchemaAgreement (line 574) | func (c *controlConn) awaitSchemaAgreement() error {
    method close (line 579) | func (c *controlConn) close() {
  function createControlConn (line 92) | func createControlConn(session *Session) *controlConn {
  function resolveInitialEndpoint (line 147) | func resolveInitialEndpoint(resolver DNSResolver, addr string, defaultPo...
  function shuffleHosts (line 202) | func shuffleHosts(hosts []*HostInfo) []*HostInfo {
  function parseProtocolFromError (line 218) | func parseProtocolFromError(err error) int {
  type connHost (line 312) | type connHost struct

FILE: control_integration_test.go
  type unixSocketDialer (line 14) | type unixSocketDialer struct
    method DialContext (line 19) | func (d unixSocketDialer) DialContext(_ context.Context, _, _ string) ...
  function TestUnixSockets (line 23) | func TestUnixSockets(t *testing.T) {

FILE: control_test.go
  function TestHostInfo_Lookup (line 37) | func TestHostInfo_Lookup(t *testing.T) {
  function TestParseProtocol (line 64) | func TestParseProtocol(t *testing.T) {

FILE: cqltypes.go
  type Duration (line 27) | type Duration struct

FILE: debounce/refresh_deboucer.go
  constant RingRefreshDebounceTime (line 9) | RingRefreshDebounceTime = 1 * time.Second
  type RefreshDebouncer (line 13) | type RefreshDebouncer struct
    method Debounce (line 40) | func (d *RefreshDebouncer) Debounce() {
    method RefreshNow (line 50) | func (d *RefreshDebouncer) RefreshNow() <-chan error {
    method flusher (line 64) | func (d *RefreshDebouncer) flusher() {
    method Stop (line 105) | func (d *RefreshDebouncer) Stop() {
  function NewRefreshDebouncer (line 24) | func NewRefreshDebouncer(interval time.Duration, refreshFn func() error)...
  type errorBroadcaster (line 118) | type errorBroadcaster struct
    method newListener (line 130) | func (b *errorBroadcaster) newListener() <-chan error {
    method broadcast (line 138) | func (b *errorBroadcaster) broadcast(err error) {
    method stop (line 154) | func (b *errorBroadcaster) stop() {
  function newErrorBroadcaster (line 123) | func newErrorBroadcaster() *errorBroadcaster {

FILE: debounce/refresh_debouncer_test.go
  function TestRefreshDebouncer_MultipleEvents (line 15) | func TestRefreshDebouncer_MultipleEvents(t *testing.T) {
  function TestRefreshDebouncer_RefreshNow (line 60) | func TestRefreshDebouncer_RefreshNow(t *testing.T) {
  function TestRefreshDebouncer_EventsAfterRefreshNow (line 126) | func TestRefreshDebouncer_EventsAfterRefreshNow(t *testing.T) {
  function TestErrorBroadcaster_MultipleListeners (line 184) | func TestErrorBroadcaster_MultipleListeners(t *testing.T) {
  function TestErrorBroadcaster_StopWithoutBroadcast (line 221) | func TestErrorBroadcaster_StopWithoutBroadcast(t *testing.T) {

FILE: debounce/simple_debouncer.go
  type SimpleDebouncer (line 13) | type SimpleDebouncer struct
    method Debounce (line 24) | func (d *SimpleDebouncer) Debounce(fn func()) bool {
  function NewSimpleDebouncer (line 19) | func NewSimpleDebouncer() *SimpleDebouncer {

FILE: debounce/simple_debouncer_test.go
  function TestSimpleDebouncerRace (line 15) | func TestSimpleDebouncerRace(t *testing.T) {
  function TestDebouncerExtreme (line 67) | func TestDebouncerExtreme(t *testing.T) {
  function TestSimpleDebouncerCount (line 115) | func TestSimpleDebouncerCount(t *testing.T) {
  function TestSimpleDebouncer (line 155) | func TestSimpleDebouncer(t *testing.T) {
  function waitTillChannelIsEmpty (line 203) | func waitTillChannelIsEmpty(ch chan struct{}) {

FILE: dial.go
  type HostDialer (line 37) | type HostDialer interface
  type DialedHost (line 48) | type DialedHost struct
  type defaultHostDialer (line 58) | type defaultHostDialer struct
    method DialHost (line 63) | func (hd *defaultHostDialer) DialHost(ctx context.Context, host *HostI...
  function tlsConfigForAddr (line 86) | func tlsConfigForAddr(tlsConfig *tls.Config, addr string) *tls.Config {
  function WrapTLS (line 105) | func WrapTLS(ctx context.Context, conn net.Conn, addr string, tlsConfig ...

FILE: dialer/recorder/recorder.go
  function NewRecordDialer (line 17) | func NewRecordDialer(dir string) *RecordDialer {
  type RecordDialer (line 23) | type RecordDialer struct
    method DialContext (line 28) | func (d *RecordDialer) DialContext(ctx context.Context, network, addr ...
  function NewConnectionRecorder (line 47) | func NewConnectionRecorder(fname string, conn net.Conn) (net.Conn, error) {
  type FrameWriter (line 59) | type FrameWriter struct
    method Write (line 65) | func (f *FrameWriter) Write(b []byte, n int, file *os.File) (err error) {
  type ConnectionRecorder (line 97) | type ConnectionRecorder struct
    method Read (line 105) | func (c *ConnectionRecorder) Read(b []byte) (n int, err error) {
    method Write (line 114) | func (c *ConnectionRecorder) Write(b []byte) (n int, err error) {
    method Close (line 123) | func (c ConnectionRecorder) Close() error {
    method LocalAddr (line 133) | func (c ConnectionRecorder) LocalAddr() net.Addr {
    method RemoteAddr (line 137) | func (c ConnectionRecorder) RemoteAddr() net.Addr {
    method SetDeadline (line 141) | func (c ConnectionRecorder) SetDeadline(t time.Time) error {
    method SetReadDeadline (line 145) | func (c ConnectionRecorder) SetReadDeadline(t time.Time) error {
    method SetWriteDeadline (line 149) | func (c ConnectionRecorder) SetWriteDeadline(t time.Time) error {

FILE: dialer/replayer/replayer.go
  function NewReplayDialer (line 18) | func NewReplayDialer(dir string) *ReplayDialer {
  type ReplayDialer (line 24) | type ReplayDialer struct
    method DialContext (line 29) | func (d *ReplayDialer) DialContext(ctx context.Context, network, addr ...
  function NewConnectionReplayer (line 34) | func NewConnectionReplayer(fname string) (net.Conn, error) {
  type ConnectionReplayer (line 42) | type ConnectionReplayer struct
    method frameStreamID (line 52) | func (c *ConnectionReplayer) frameStreamID() int {
    method getPendingFrame (line 56) | func (c *ConnectionReplayer) getPendingFrame() *FrameRecorded {
    method pushStreamIDToReplay (line 67) | func (c *ConnectionReplayer) pushStreamIDToReplay(b []byte, idx int) {
    method Read (line 90) | func (c *ConnectionReplayer) Read(b []byte) (n int, err error) {
    method Write (line 117) | func (c *ConnectionReplayer) Write(b []byte) (n int, err error) {
    method Close (line 129) | func (c *ConnectionReplayer) Close() error {
    method Closed (line 135) | func (c *ConnectionReplayer) Closed() bool {
    method LocalAddr (line 152) | func (c ConnectionReplayer) LocalAddr() net.Addr {
    method RemoteAddr (line 159) | func (c ConnectionReplayer) RemoteAddr() net.Addr {
    method SetDeadline (line 166) | func (c ConnectionReplayer) SetDeadline(t time.Time) error {
    method SetReadDeadline (line 170) | func (c ConnectionReplayer) SetReadDeadline(t time.Time) error {
    method SetWriteDeadline (line 174) | func (c ConnectionReplayer) SetWriteDeadline(t time.Time) error {
  function replaceFrameStreamID (line 81) | func replaceFrameStreamID(b []byte, stream int) {
  type MockAddr (line 139) | type MockAddr struct
    method Network (line 144) | func (m *MockAddr) Network() string {
    method String (line 148) | func (m *MockAddr) String() string {
  function loadFramesFromFile (line 178) | func loadFramesFromFile(filename string) (map[int]dialer.Record, error) {
  function loadResponseFramesFromFiles (line 203) | func loadResponseFramesFromFiles(read_file, write_file string) ([]*Frame...
  type FrameRecorded (line 222) | type FrameRecorded struct

FILE: dialer/utils.go
  type Record (line 8) | type Record struct
  type frameOp (line 13) | type frameOp
  constant opError (line 17) | opError         frameOp = 0x00
  constant opStartup (line 18) | opStartup       frameOp = 0x01
  constant opReady (line 19) | opReady         frameOp = 0x02
  constant opAuthenticate (line 20) | opAuthenticate  frameOp = 0x03
  constant opOptions (line 21) | opOptions       frameOp = 0x05
  constant opSupported (line 22) | opSupported     frameOp = 0x06
  constant opQuery (line 23) | opQuery         frameOp = 0x07
  constant opResult (line 24) | opResult        frameOp = 0x08
  constant opPrepare (line 25) | opPrepare       frameOp = 0x09
  constant opExecute (line 26) | opExecute       frameOp = 0x0A
  constant opRegister (line 27) | opRegister      frameOp = 0x0B
  constant opEvent (line 28) | opEvent         frameOp = 0x0C
  constant opBatch (line 29) | opBatch         frameOp = 0x0D
  constant opAuthChallenge (line 30) | opAuthChallenge frameOp = 0x0E
  constant opAuthResponse (line 31) | opAuthResponse  frameOp = 0x0F
  constant opAuthSuccess (line 32) | opAuthSuccess   frameOp = 0x10
  function addBytes (line 35) | func addBytes(frame []byte, index int) int {
  function addQueryParams (line 44) | func addQueryParams(frame []byte, index int) int {
  function addHeader (line 97) | func addHeader(index int) int {
  function addCustomPayload (line 101) | func addCustomPayload(frame []byte, index int, p int) int {
  function GetFrameHash (line 115) | func GetFrameHash(frame []byte) int64 {

FILE: dns_test.go
  type mockDNSResolver (line 14) | type mockDNSResolver struct
    method LookupIP (line 26) | func (r *mockDNSResolver) LookupIP(host string) ([]net.IP, error) {
    method Update (line 36) | func (r *mockDNSResolver) Update(host string, ips ...net.IP) {
    method Delete (line 42) | func (r *mockDNSResolver) Delete(hosts ...string) {
  function newMockDNSResolver (line 19) | func newMockDNSResolver() *mockDNSResolver {
  function MustIP (line 50) | func MustIP(ip string) net.IP {
  function TestDNS (line 58) | func TestDNS(t *testing.T) {

FILE: docs/source/conf.py
  function setup (line 132) | def setup(sphinx):

FILE: errors.go
  constant ErrCodeServer (line 39) | ErrCodeServer = 0x0000
  constant ErrCodeProtocol (line 43) | ErrCodeProtocol = 0x000A
  constant ErrCodeCredentials (line 47) | ErrCodeCredentials = 0x0100
  constant ErrCodeUnavailable (line 51) | ErrCodeUnavailable = 0x1000
  constant ErrCodeOverloaded (line 55) | ErrCodeOverloaded = 0x1001
  constant ErrCodeBootstrapping (line 59) | ErrCodeBootstrapping = 0x1002
  constant ErrCodeTruncate (line 63) | ErrCodeTruncate = 0x1003
  constant ErrCodeWriteTimeout (line 67) | ErrCodeWriteTimeout = 0x1100
  constant ErrCodeReadTimeout (line 71) | ErrCodeReadTimeout = 0x1200
  constant ErrCodeReadFailure (line 75) | ErrCodeReadFailure = 0x1300
  constant ErrCodeFunctionFailure (line 79) | ErrCodeFunctionFailure = 0x1400
  constant ErrCodeWriteFailure (line 83) | ErrCodeWriteFailure = 0x1500
  constant ErrCodeCDCWriteFailure (line 87) | ErrCodeCDCWriteFailure = 0x1600
  constant ErrCodeCASWriteUnknown (line 91) | ErrCodeCASWriteUnknown = 0x1700
  constant ErrCodeSyntax (line 95) | ErrCodeSyntax = 0x2000
  constant ErrCodeUnauthorized (line 99) | ErrCodeUnauthorized = 0x2100
  constant ErrCodeInvalid (line 103) | ErrCodeInvalid = 0x2200
  constant ErrCodeConfig (line 107) | ErrCodeConfig = 0x2300
  constant ErrCodeAlreadyExists (line 111) | ErrCodeAlreadyExists = 0x2400
  constant ErrCodeUnprepared (line 115) | ErrCodeUnprepared = 0x2500
  type RequestError (line 118) | type RequestError interface
  type RequestErrUnavailable (line 124) | type RequestErrUnavailable struct
    method String (line 131) | func (e *RequestErrUnavailable) String() string {
  type ErrorMap (line 135) | type ErrorMap
  type RequestErrWriteTimeout (line 137) | type RequestErrWriteTimeout struct
  type RequestErrWriteFailure (line 145) | type RequestErrWriteFailure struct
  type RequestErrCDCWriteFailure (line 155) | type RequestErrCDCWriteFailure struct
  type RequestErrReadTimeout (line 159) | type RequestErrReadTimeout struct
  type RequestErrAlreadyExists (line 167) | type RequestErrAlreadyExists struct
  type RequestErrUnprepared (line 173) | type RequestErrUnprepared struct
  type RequestErrReadFailure (line 178) | type RequestErrReadFailure struct
  type RequestErrFunctionFailure (line 188) | type RequestErrFunctionFailure struct
  type RequestErrCASWriteUnknown (line 198) | type RequestErrCASWriteUnknown struct
  type UnknownServerError (line 205) | type UnknownServerError struct
  type OpType (line 209) | type OpType
  constant OpTypeRead (line 212) | OpTypeRead  OpType = 0
  constant OpTypeWrite (line 213) | OpTypeWrite OpType = 1
  type RequestErrRateLimitReached (line 216) | type RequestErrRateLimitReached struct
    method String (line 222) | func (e *RequestErrRateLimitReached) String() string {

FILE: errors_test.go
  function TestErrorsParse (line 36) | func TestErrorsParse(t *testing.T) {

FILE: events.go
  type eventDebouncer (line 37) | type eventDebouncer struct
    method stop (line 61) | func (e *eventDebouncer) stop() {
    method flusher (line 66) | func (e *eventDebouncer) flusher() {
    method flush (line 85) | func (e *eventDebouncer) flush() {
    method debounce (line 97) | func (e *eventDebouncer) debounce(frame frame) {
  function newEventDebouncer (line 47) | func newEventDebouncer(name string, eventHandler func([]frame), logger S...
  constant eventBufferSize (line 80) | eventBufferSize   = 1000
  constant eventDebounceTime (line 81) | eventDebounceTime = 1 * time.Second
  method publishEvent (line 111) | func (s *Session) publishEvent(event events.Event) {
  method handleEvent (line 121) | func (s *Session) handleEvent(frame frame) {
  method handleSchemaEvent (line 144) | func (s *Session) handleSchemaEvent(frames []frame) {
  method handleKeyspaceChange (line 164) | func (s *Session) handleKeyspaceChange(keyspace, change string) {
  method handleTableChange (line 172) | func (s *Session) handleTableChange(keyspace, table, change string) {
  method handleNodeEvent (line 188) | func (s *Session) handleNodeEvent(frames []frame) {
  method handleNodeUp (line 237) | func (s *Session) handleNodeUp(eventIp net.IP, eventPort int) {
  method startPoolFill (line 258) | func (s *Session) startPoolFill(host *HostInfo) {
  method handleNodeConnected (line 264) | func (s *Session) handleNodeConnected(host *HostInfo) {
  method handleNodeDown (line 276) | func (s *Session) handleNodeDown(ip net.IP, port int) {

FILE: events/event_converter.go
  function FrameToEvent (line 29) | func FrameToEvent(f any) Event {

FILE: events/event_converter_test.go
  function TestFrameToEvent_TopologyChange (line 32) | func TestFrameToEvent_TopologyChange(t *testing.T) {
  function TestFrameToEvent_StatusChange (line 63) | func TestFrameToEvent_StatusChange(t *testing.T) {
  function TestFrameToEvent_SchemaChangeKeyspace (line 94) | func TestFrameToEvent_SchemaChangeKeyspace(t *testing.T) {
  function TestFrameToEvent_SchemaChangeTable (line 121) | func TestFrameToEvent_SchemaChangeTable(t *testing.T) {
  function TestFrameToEvent_SchemaChangeType (line 152) | func TestFrameToEvent_SchemaChangeType(t *testing.T) {
  function TestFrameToEvent_SchemaChangeFunction (line 183) | func TestFrameToEvent_SchemaChangeFunction(t *testing.T) {
  function TestFrameToEvent_SchemaChangeAggregate (line 218) | func TestFrameToEvent_SchemaChangeAggregate(t *testing.T) {
  function TestFrameToEvent_Nil (line 253) | func TestFrameToEvent_Nil(t *testing.T) {
  function TestFrameToEvent_NonEventFrame (line 260) | func TestFrameToEvent_NonEventFrame(t *testing.T) {
  function TestFrameToEvent_ClientRoutesChanged (line 269) | func TestFrameToEvent_ClientRoutesChanged(t *testing.T) {

FILE: events/events.go
  type EventType (line 30) | type EventType
    method IsClusterEvent (line 53) | func (t EventType) IsClusterEvent() bool {
    method String (line 76) | func (t EventType) String() string {
  constant ClusterEventTypeTopologyChange (line 34) | ClusterEventTypeTopologyChange EventType = iota
  constant ClusterEventTypeStatusChange (line 36) | ClusterEventTypeStatusChange
  constant ClusterEventTypeSchemaChangeKeyspace (line 38) | ClusterEventTypeSchemaChangeKeyspace
  constant ClusterEventTypeSchemaChangeTable (line 40) | ClusterEventTypeSchemaChangeTable
  constant ClusterEventTypeSchemaChangeType (line 42) | ClusterEventTypeSchemaChangeType
  constant ClusterEventTypeSchemaChangeFunction (line 44) | ClusterEventTypeSchemaChangeFunction
  constant ClusterEventTypeSchemaChangeAggregate (line 46) | ClusterEventTypeSchemaChangeAggregate
  constant ClusterEventTypeClientRoutesChanged (line 48) | ClusterEventTypeClientRoutesChanged
  constant SessionEventTypeControlConnectionRecreated (line 50) | SessionEventTypeControlConnectionRecreated
  type Event (line 102) | type Event interface
  type TopologyChangeEvent (line 110) | type TopologyChangeEvent struct
    method Type (line 120) | func (e *TopologyChangeEvent) Type() EventType {
    method String (line 125) | func (e *TopologyChangeEvent) String() string {
  type StatusChangeEvent (line 130) | type StatusChangeEvent struct
    method Type (line 140) | func (e *StatusChangeEvent) Type() EventType {
    method String (line 145) | func (e *StatusChangeEvent) String() string {
  type SchemaChangeKeyspaceEvent (line 150) | type SchemaChangeKeyspaceEvent struct
    method Type (line 158) | func (e *SchemaChangeKeyspaceEvent) Type() EventType {
    method String (line 163) | func (e *SchemaChangeKeyspaceEvent) String() string {
  type SchemaChangeTableEvent (line 168) | type SchemaChangeTableEvent struct
    method Type (line 178) | func (e *SchemaChangeTableEvent) Type() EventType {
    method String (line 183) | func (e *SchemaChangeTableEvent) String() string {
  type SchemaChangeTypeEvent (line 188) | type SchemaChangeTypeEvent struct
    method Type (line 198) | func (e *SchemaChangeTypeEvent) Type() EventType {
    method String (line 203) | func (e *SchemaChangeTypeEvent) String() string {
  type SchemaChangeFunctionEvent (line 208) | type SchemaChangeFunctionEvent struct
    method Type (line 220) | func (e *SchemaChangeFunctionEvent) Type() EventType {
    method String (line 225) | func (e *SchemaChangeFunctionEvent) String() string {
  type SchemaChangeAggregateEvent (line 231) | type SchemaChangeAggregateEvent struct
    method Type (line 243) | func (e *SchemaChangeAggregateEvent) Type() EventType {
    method String (line 248) | func (e *SchemaChangeAggregateEvent) String() string {
  type ClientRoutesChangedEvent (line 254) | type ClientRoutesChangedEvent struct
    method Type (line 264) | func (e *ClientRoutesChangedEvent) Type() EventType {
    method String (line 269) | func (e *ClientRoutesChangedEvent) String() string {
  type HostInfo (line 274) | type HostInfo struct
    method String (line 281) | func (h *HostInfo) String() string {
  type ControlConnectionRecreatedEvent (line 286) | type ControlConnectionRecreatedEvent struct
    method Type (line 292) | func (e *ControlConnectionRecreatedEvent) Type() EventType {
    method String (line 297) | func (e *ControlConnectionRecreatedEvent) String() string {

FILE: events/events_test.go
  function TestTopologyChangeEvent (line 29) | func TestTopologyChangeEvent(t *testing.T) {
  function TestStatusChangeEvent (line 47) | func TestStatusChangeEvent(t *testing.T) {
  function TestSchemaChangeKeyspaceEvent (line 65) | func TestSchemaChangeKeyspaceEvent(t *testing.T) {
  function TestSchemaChangeTableEvent (line 82) | func TestSchemaChangeTableEvent(t *testing.T) {
  function TestSchemaChangeTypeEvent (line 100) | func TestSchemaChangeTypeEvent(t *testing.T) {
  function TestSchemaChangeFunctionEvent (line 118) | func TestSchemaChangeFunctionEvent(t *testing.T) {
  function TestSchemaChangeAggregateEvent (line 137) | func TestSchemaChangeAggregateEvent(t *testing.T) {
  function TestClientRoutesChangedEvent (line 156) | func TestClientRoutesChangedEvent(t *testing.T) {
  function TestEventInterface (line 174) | func TestEventInterface(t *testing.T) {

FILE: events_test.go
  function TestEventDebounce (line 39) | func TestEventDebounce(t *testing.T) {
  function TestEventDebounceMultipleFlushes (line 79) | func TestEventDebounceMultipleFlushes(t *testing.T) {

FILE: events_unit_test.go
  function mustMarshal (line 104) | func mustMarshal(info TypeInfo, value any) []byte {
  function marshalRow (line 112) | func marshalRow(meta resultMetadata, values []any) [][]byte {
  function makeKeyspaceRow (line 123) | func makeKeyspaceRow(durableWrites bool) [][]byte {
  function makeTableRow (line 131) | func makeTableRow(tableName string) [][]byte {
  function makeColumnRow (line 151) | func makeColumnRow(tableName, colName, kind string, position int) [][]by...
  function makeIter (line 162) | func makeIter(meta resultMetadata, rows ...[][]byte) *Iter {
  type tableInfo (line 177) | type tableInfo struct
  type columnInfo (line 182) | type columnInfo struct
  type schemaDataMock (line 188) | type schemaDataMock struct
    method awaitSchemaAgreement (line 200) | func (m *schemaDataMock) awaitSchemaAgreement() error {
    method query (line 207) | func (m *schemaDataMock) query(statement string, values ...any) *Iter {
    method querySystem (line 220) | func (m *schemaDataMock) querySystem(statement string, values ...any) ...
    method setQueryError (line 331) | func (m *schemaDataMock) setQueryError(err error) {
    method resetQueries (line 337) | func (m *schemaDataMock) resetQueries() {
    method getStatements (line 343) | func (m *schemaDataMock) getStatements() []string {
    method getQueryCount (line 353) | func (m *schemaDataMock) getQueryCount() int {
    method getAwaitSchemaAgreementCalls (line 359) | func (m *schemaDataMock) getAwaitSchemaAgreementCalls() int {
  function newSchemaEventTestSession (line 365) | func newSchemaEventTestSession(control controlConnection, policy HostSel...
  function newSchemaEventTestSessionWithMock (line 385) | func newSchemaEventTestSessionWithMock(mockCtrl *schemaDataMock) *Session {
  function populateKeyspace (line 392) | func populateKeyspace(s *Session, ksName string, tableNames ...string) {
  type trackingPolicy (line 410) | type trackingPolicy struct
    method KeyspaceChanged (line 416) | func (t *trackingPolicy) KeyspaceChanged(event KeyspaceUpdateEvent) {
    method getKeyspaceChangedCalls (line 422) | func (t *trackingPolicy) getKeyspaceChangedCalls() []KeyspaceUpdateEve...
  type queryRecord (line 430) | type queryRecord struct
  function addTestTablets (line 435) | func addTestTablets(t *testing.T, session *Session, ksName, tblName stri...
  function TestHandleSchemaEvent (line 460) | func TestHandleSchemaEvent(t *testing.T) {
  function TestSchemaRefreshConcurrent (line 1104) | func TestSchemaRefreshConcurrent(t *testing.T) {
  function TestConcurrentSchemaRefreshErrorHandling (line 1251) | func TestConcurrentSchemaRefreshErrorHandling(t *testing.T) {

FILE: example_batch_test.go
  function Example_batch (line 36) | func Example_batch() {

FILE: example_dynamic_columns_test.go
  function Example_dynamicColumns (line 39) | func Example_dynamicColumns() {

FILE: example_lwt_batch_test.go
  function ExampleSession_MapExecuteBatchCAS (line 36) | func ExampleSession_MapExecuteBatchCAS() {

FILE: example_lwt_test.go
  function ExampleQuery_MapScanCAS (line 36) | func ExampleQuery_MapScanCAS() {

FILE: example_marshaler_test.go
  type MyMarshaler (line 39) | type MyMarshaler struct
    method MarshalCQL (line 43) | func (m MyMarshaler) MarshalCQL(info gocql.TypeInfo) ([]byte, error) {
    method UnmarshalCQL (line 47) | func (m *MyMarshaler) UnmarshalCQL(info gocql.TypeInfo, data []byte) e...
  function Example_marshalerUnmarshaler (line 76) | func Example_marshalerUnmarshaler() {

FILE: example_nulls_test.go
  function Example_nulls (line 38) | func Example_nulls() {

FILE: example_paging_test.go
  function Example_paging (line 37) | func Example_paging() {

FILE: example_set_test.go
  function Example_set (line 36) | func Example_set() {

FILE: example_test.go
  function Example (line 35) | func Example() {

FILE: example_udt_map_test.go
  function Example_userDefinedTypesMap (line 37) | func Example_userDefinedTypesMap() {

FILE: example_udt_marshaler_test.go
  type MyUDTMarshaler (line 35) | type MyUDTMarshaler struct
    method MarshalUDT (line 41) | func (m MyUDTMarshaler) MarshalUDT(name string, info gocql.TypeInfo) (...
  function ExampleUDTMarshaler (line 56) | func ExampleUDTMarshaler() {

FILE: example_udt_struct_test.go
  type MyUDT (line 35) | type MyUDT struct
  function Example_userDefinedTypesStruct (line 42) | func Example_userDefinedTypesStruct() {

FILE: example_udt_unmarshaler_test.go
  type MyUDTUnmarshaler (line 36) | type MyUDTUnmarshaler struct
    method UnmarshalUDT (line 42) | func (m *MyUDTUnmarshaler) UnmarshalUDT(name string, info gocql.TypeIn...
  function ExampleUDTUnmarshaler (line 57) | func ExampleUDTUnmarshaler() {

FILE: exec.go
  type SingleHostQueryExecutor (line 14) | type SingleHostQueryExecutor struct
    method Exec (line 20) | func (e SingleHostQueryExecutor) Exec(stmt string, values ...any) error {
    method Iter (line 26) | func (e SingleHostQueryExecutor) Iter(stmt string, values ...any) *Iter {
    method Close (line 30) | func (e SingleHostQueryExecutor) Close() {
  function NewSingleHostQueryExecutor (line 43) | func NewSingleHostQueryExecutor(cfg *ClusterConfig) (e SingleHostQueryEx...

FILE: exec_test.go
  function TestSingleHostQueryExecutor (line 10) | func TestSingleHostQueryExecutor(t *testing.T) {

FILE: export_test.go
  function GetRingAllHosts (line 12) | func GetRingAllHosts(sess *Session) []*HostInfo {

FILE: filters.go
  type HostFilter (line 30) | type HostFilter interface
  type HostFilterFunc (line 37) | type HostFilterFunc
    method Accept (line 39) | func (fn HostFilterFunc) Accept(host *HostInfo) bool {
  function AcceptAllFilter (line 44) | func AcceptAllFilter() HostFilter {
  function DenyAllFilter (line 50) | func DenyAllFilter() HostFilter {
  function DataCenterHostFilter (line 58) | func DataCenterHostFilter(dataCenter string) HostFilter {
  function DataCentreHostFilter (line 66) | func DataCentreHostFilter(dataCenter string) HostFilter {
  function WhiteListHostFilter (line 73) | func WhiteListHostFilter(hosts ...string) HostFilter {

FILE: filters_test.go
  function TestFilter_WhiteList (line 35) | func TestFilter_WhiteList(t *testing.T) {
  function TestFilter_AllowAll (line 59) | func TestFilter_AllowAll(t *testing.T) {
  function TestFilter_DenyAll (line 83) | func TestFilter_DenyAll(t *testing.T) {
  function TestFilter_WhiteList_MatchesRPCAddress (line 107) | func TestFilter_WhiteList_MatchesRPCAddress(t *testing.T) {
  function TestFilter_WhiteList_MatchesBroadcastAddress (line 121) | func TestFilter_WhiteList_MatchesBroadcastAddress(t *testing.T) {
  function TestFilter_WhiteList_MatchesListenAddress (line 135) | func TestFilter_WhiteList_MatchesListenAddress(t *testing.T) {
  function TestFilter_WhiteList_MatchesPeer (line 149) | func TestFilter_WhiteList_MatchesPeer(t *testing.T) {
  function TestFilter_WhiteList_MatchesPreferredIP (line 163) | func TestFilter_WhiteList_MatchesPreferredIP(t *testing.T) {
  function TestFilter_WhiteList_MatchesTranslatedAddress (line 177) | func TestFilter_WhiteList_MatchesTranslatedAddress(t *testing.T) {
  function TestFilter_WhiteList_NoMatchWhenNoAddressMatches (line 193) | func TestFilter_WhiteList_NoMatchWhenNoAddressMatches(t *testing.T) {
  function TestFilter_WhiteList_EmptyHost (line 211) | func TestFilter_WhiteList_EmptyHost(t *testing.T) {
  function TestFilter_DataCenter (line 222) | func TestFilter_DataCenter(t *testing.T) {

FILE: frame.go
  type unsetColumn (line 43) | type unsetColumn struct
  type namedValue (line 54) | type namedValue struct
  function NamedValue (line 60) | func NamedValue(name string, value any) any {
  constant protoDirectionMask (line 68) | protoDirectionMask = 0x80
  constant protoVersionMask (line 69) | protoVersionMask   = 0x7F
  constant protoVersion1 (line 70) | protoVersion1      = 0x01
  constant protoVersion2 (line 71) | protoVersion2      = 0x02
  constant protoVersion3 (line 72) | protoVersion3      = 0x03
  constant protoVersion4 (line 73) | protoVersion4      = 0x04
  constant protoVersion5 (line 74) | protoVersion5      = 0x05
  constant maxFrameSize (line 76) | maxFrameSize = 256 * 1024 * 1024
  type Consistency (line 82) | type Consistency
    method String (line 98) | func (c Consistency) String() string {
    method IsSerial (line 127) | func (c Consistency) IsSerial() bool {
    method MarshalText (line 131) | func (c Consistency) MarshalText() (text []byte, err error) {
    method UnmarshalText (line 135) | func (c *Consistency) UnmarshalText(text []byte) error {
  constant Any (line 85) | Any         Consistency = 0x00
  constant One (line 86) | One         Consistency = 0x01
  constant Two (line 87) | Two         Consistency = 0x02
  constant Three (line 88) | Three       Consistency = 0x03
  constant Quorum (line 89) | Quorum      Consistency = 0x04
  constant All (line 90) | All         Consistency = 0x05
  constant LocalQuorum (line 91) | LocalQuorum Consistency = 0x06
  constant EachQuorum (line 92) | EachQuorum  Consistency = 0x07
  constant Serial (line 93) | Serial      Consistency = 0x08
  constant LocalSerial (line 94) | LocalSerial Consistency = 0x09
  constant LocalOne (line 95) | LocalOne    Consistency = 0x0A
  function ParseConsistency (line 165) | func ParseConsistency(s string) Consistency {
  function ParseConsistencyWrapper (line 175) | func ParseConsistencyWrapper(s string) (consistency Consistency, err err...
  constant apacheCassandraTypePrefix (line 181) | apacheCassandraTypePrefix = "org.apache.cassandra.db.marshal."
  function readInt (line 188) | func readInt(p []byte) int32 {
  constant defaultBufSize (line 192) | defaultBufSize = 128
  type ObservedFrameHeader (line 194) | type ObservedFrameHeader struct
    method String (line 208) | func (f ObservedFrameHeader) String() string {
  type FrameHeaderObserver (line 215) | type FrameHeaderObserver interface
  type framerInterface (line 230) | type framerInterface interface
  constant headSize (line 240) | headSize = 9
  type framer (line 243) | type framer struct
    method Release (line 290) | func (f *framer) Release() {
    method trace (line 363) | func (f *framer) trace() {
    method payload (line 368) | func (f *framer) payload() {
    method readFrame (line 373) | func (f *framer) readFrame(r io.Reader, head *frm.FrameHeader) error {
    method parseFrame (line 413) | func (f *framer) parseFrame() (frame frame, err error) {
    method parseErrorFrame (line 464) | func (f *framer) parseErrorFrame() frame {
    method readErrorMap (line 595) | func (f *framer) readErrorMap() (errMap ErrorMap) {
    method writeHeader (line 605) | func (f *framer) writeHeader(flags byte, op frm.Op, stream int) {
    method setLength (line 613) | func (f *framer) setLength(length int) {
    method finish (line 620) | func (f *framer) finish() error {
    method writeTo (line 648) | func (f *framer) writeTo(w io.Writer) error {
    method readTrace (line 653) | func (f *framer) readTrace() {
    method parseReadyFrame (line 664) | func (f *framer) parseReadyFrame() frame {
    method parseSupportedFrame (line 672) | func (f *framer) parseSupportedFrame() frame {
    method readTypeInfo (line 727) | func (f *framer) readTypeInfo() TypeInfo {
    method parsePreparedMetadata (line 828) | func (f *framer) parsePreparedMetadata() preparedMetadata {
    method readColWithSpec (line 936) | func (f *framer) readColWithSpec(col *ColumnInfo, meta *resultMetadata...
    method parseResultMetadata (line 961) | func (f *framer) parseResultMetadata() resultMetadata {
    method parseResultFrame (line 1021) | func (f *framer) parseResultFrame() (frame, error) {
    method parseResultRows (line 1052) | func (f *framer) parseResultRows() frame {
    method parseResultSetKeyspace (line 1073) | func (f *framer) parseResultSetKeyspace() frame {
    method parseResultPrepared (line 1087) | func (f *framer) parseResultPrepared() frame {
    method parseResultSchemaChange (line 1099) | func (f *framer) parseResultSchemaChange() frame {
    method parseAuthenticateFrame (line 1146) | func (f *framer) parseAuthenticateFrame() frame {
    method parseAuthSuccessFrame (line 1153) | func (f *framer) parseAuthSuccessFrame() frame {
    method parseAuthChallengeFrame (line 1160) | func (f *framer) parseAuthChallengeFrame() frame {
    method parseEventFrame (line 1167) | func (f *framer) parseEventFrame() frame {
    method writeAuthResponseFrame (line 1211) | func (f *framer) writeAuthResponseFrame(streamID int, data []byte) err...
    method writeQueryParams (line 1240) | func (f *framer) writeQueryParams(opts *queryParams) {
    method writeQueryFrame (line 1343) | func (f *framer) writeQueryFrame(streamID int, statement string, param...
    method writeExecuteFrame (line 1379) | func (f *framer) writeExecuteFrame(streamID int, preparedID []byte, pa...
    method writeBatchFrame (line 1413) | func (f *framer) writeBatchFrame(streamID int, w *writeBatchFrame, cus...
    method writeOptionsFrame (line 1494) | func (f *framer) writeOptionsFrame(stream int, _ *writeOptionsFrame) e...
    method writeRegisterFrame (line 1507) | func (f *framer) writeRegisterFrame(streamID int, w *writeRegisterFram...
    method readByte (line 1514) | func (f *framer) readByte() byte {
    method readInt (line 1524) | func (f *framer) readInt() (n int) {
    method readShort (line 1534) | func (f *framer) readShort() (n uint16) {
    method readString (line 1543) | func (f *framer) readString() (s string) {
    method skipString (line 1556) | func (f *framer) skipString() {
    method readLongString (line 1566) | func (f *framer) readLongString() (s string) {
    method readStringList (line 1578) | func (f *framer) readStringList() []string {
    method ReadBytesInternal (line 1589) | func (f *framer) ReadBytesInternal() ([]byte, error) {
    method readBytesCopy (line 1605) | func (f *framer) readBytesCopy() []byte {
    method readShortBytesCopy (line 1621) | func (f *framer) readShortBytesCopy() []byte {
    method readInetAdressOnly (line 1634) | func (f *framer) readInetAdressOnly() net.IP {
    method readInet (line 1656) | func (f *framer) readInet() (net.IP, int) {
    method readConsistency (line 1660) | func (f *framer) readConsistency() Consistency {
    method readBytesMap (line 1664) | func (f *framer) readBytesMap() map[string][]byte {
    method readStringMultiMap (line 1675) | func (f *framer) readStringMultiMap() map[string][]string {
    method writeByte (line 1688) | func (f *framer) writeByte(b byte) {
    method writeCustomPayload (line 1739) | func (f *framer) writeCustomPayload(customPayload *map[string][]byte) {
    method GetCustomPayload (line 1748) | func (f *framer) GetCustomPayload() map[string][]byte {
    method GetHeaderWarnings (line 1752) | func (f *framer) GetHeaderWarnings() []string {
    method writeInt (line 1757) | func (f *framer) writeInt(n int32) {
    method writeIntNeg1 (line 1761) | func (f *framer) writeIntNeg1() {
    method writeIntNeg2 (line 1765) | func (f *framer) writeIntNeg2() {
    method writeUint (line 1769) | func (f *framer) writeUint(n uint32) {
    method writeShort (line 1773) | func (f *framer) writeShort(n uint16) {
    method writeLong (line 1777) | func (f *framer) writeLong(n int64) {
    method writeString (line 1781) | func (f *framer) writeString(s string) {
    method writeLongString (line 1786) | func (f *framer) writeLongString(s string) {
    method writeStringList (line 1791) | func (f *framer) writeStringList(l []string) {
    method writeUnset (line 1798) | func (f *framer) writeUnset() {
    method writeBytes (line 1806) | func (f *framer) writeBytes(p []byte) {
    method writeShortBytes (line 1818) | func (f *framer) writeShortBytes(p []byte) {
    method writeConsistency (line 1823) | func (f *framer) writeConsistency(cons Consistency) {
    method writeStringMap (line 1827) | func (f *framer) writeStringMap(m map[string]string) {
    method writeStringMultiMap (line 1835) | func (f *framer) writeStringMultiMap(m map[string][]string) {
    method writeBytesMap (line 1843) | func (f *framer) writeBytesMap(m map[string][]byte) {
  function newFramer (line 259) | func newFramer(compressor Compressor, version byte) *framer {
  function newFramerWithExts (line 296) | func newFramerWithExts(compressor Compressor, version byte, cqlProtoExts...
  type frame (line 336) | type frame interface
  function readHeader (line 340) | func readHeader(r io.Reader, p []byte) (head frm.FrameHeader, err error) {
  type writeStartupFrame (line 680) | type writeStartupFrame struct
    method String (line 684) | func (w writeStartupFrame) String() string {
    method buildFrame (line 688) | func (w *writeStartupFrame) buildFrame(f *framer, streamID int) error {
  type writePrepareFrame (line 695) | type writePrepareFrame struct
    method buildFrame (line 701) | func (w *writePrepareFrame) buildFrame(f *framer, streamID int) error {
  type preparedMetadata (line 813) | type preparedMetadata struct
    method String (line 823) | func (r preparedMetadata) String() string {
  type resultMetadata (line 900) | type resultMetadata struct
    method morePages (line 911) | func (r *resultMetadata) morePages() bool {
    method String (line 915) | func (r resultMetadata) String() string {
  type keyspaceTableTracker (line 920) | type keyspaceTableTracker struct
    method track (line 926) | func (t *keyspaceTableTracker) track(colIndex int, keyspace, table str...
  type resultVoidFrame (line 1013) | type resultVoidFrame struct
    method String (line 1017) | func (f *resultVoidFrame) String() string {
  type resultRowsFrame (line 1040) | type resultRowsFrame struct
    method String (line 1048) | func (f *resultRowsFrame) String() string {
  type resultKeyspaceFrame (line 1064) | type resultKeyspaceFrame struct
    method String (line 1069) | func (r *resultKeyspaceFrame) String() string {
  type resultPreparedFrame (line 1080) | type resultPreparedFrame struct
  type writeAuthResponseFrame (line 1199) | type writeAuthResponseFrame struct
    method String (line 1203) | func (a *writeAuthResponseFrame) String() string {
    method buildFrame (line 1207) | func (a *writeAuthResponseFrame) buildFrame(framer *framer, streamID i...
  type queryValues (line 1217) | type queryValues struct
  type queryParams (line 1223) | type queryParams struct
    method String (line 1235) | func (q queryParams) String() string {
  type writeQueryFrame (line 1329) | type writeQueryFrame struct
    method String (line 1335) | func (w *writeQueryFrame) String() string {
    method buildFrame (line 1339) | func (w *writeQueryFrame) buildFrame(framer *framer, streamID int) err...
  type frameBuilder (line 1355) | type frameBuilder interface
  type frameWriterFunc (line 1359) | type frameWriterFunc
    method buildFrame (line 1361) | func (f frameWriterFunc) buildFrame(framer *framer, streamID int) error {
  type writeExecuteFrame (line 1365) | type writeExecuteFrame struct
    method String (line 1371) | func (e *writeExecuteFrame) String() string {
    method buildFrame (line 1375) | func (e *writeExecuteFrame) buildFrame(fr *framer, streamID int) error {
  type batchStatment (line 1393) | type batchStatment struct
  type writeBatchFrame (line 1399) | type writeBatchFrame struct
    method buildFrame (line 1409) | func (w *writeBatchFrame) buildFrame(framer *framer, streamID int) err...
  type writeOptionsFrame (line 1488) | type writeOptionsFrame struct
    method buildFrame (line 1490) | func (w *writeOptionsFrame) buildFrame(framer *framer, streamID int) e...
  type writeRegisterFrame (line 1499) | type writeRegisterFrame struct
    method buildFrame (line 1503) | func (w *writeRegisterFrame) buildFrame(framer *framer, streamID int) ...
  function appendBytes (line 1692) | func appendBytes(p []byte, d []byte) []byte {
  function appendShort (line 1701) | func appendShort(p []byte, n uint16) []byte {
  function appendInt (line 1708) | func appendInt(p []byte, n int32) []byte {
  function appendIntNeg1 (line 1715) | func appendIntNeg1(p []byte) []byte {
  function appendUint (line 1719) | func appendUint(p []byte, n uint32) []byte {
  function appendLong (line 1726) | func appendLong(p []byte, n int64) []byte {

FILE: frame_test.go
  function TestFuzzBugs (line 38) | func TestFuzzBugs(t *testing.T) {
  function TestFrameWriteTooLong (line 89) | func TestFrameWriteTooLong(t *testing.T) {
  function TestFrameReadTooLong (line 106) | func TestFrameReadTooLong(t *testing.T) {
  function TestParseResultMetadata_PerColumnSpec (line 140) | func TestParseResultMetadata_PerColumnSpec(t *testing.T) {
  function TestParseEventFrame_ClientRoutesChanged (line 218) | func TestParseEventFrame_ClientRoutesChanged(t *testing.T) {

FILE: framer.go
  type framerPool (line 28) | type framerPool struct
    method init (line 206) | func (fp *framerPool) init(defaults framerConfig, release func(*framer...
    method get (line 228) | func (fp *framerPool) get(c *Conn) *framer {
    method put (line 235) | func (fp *framerPool) put(f *framer) {
    method close (line 242) | func (fp *framerPool) close() {
    method updateAvg (line 246) | func (fp *framerPool) updateAvg(logger StdLogger, bufCap int64) (int64...
    method resetAndPut (line 289) | func (fp *framerPool) resetAndPut(f *framer, alignBufWithReadBuffer bo...
  type connFramers (line 35) | type connFramers struct
    method initCache (line 79) | func (cf *connFramers) initCache(c *Conn) {
    method initPool (line 116) | func (cf *connFramers) initPool(c *Conn) {
    method getRead (line 127) | func (cf *connFramers) getRead(c *Conn) *framer {
    method getWrite (line 138) | func (cf *connFramers) getWrite(c *Conn) *framer {
    method releaseRead (line 150) | func (cf *connFramers) releaseRead(c *Conn, f *framer) {
    method releaseWrite (line 178) | func (cf *connFramers) releaseWrite(f *framer) {
    method close (line 201) | func (cf *connFramers) close() {
  type framerConfig (line 43) | type framerConfig struct
  constant framerBufEWMAWeight (line 59) | framerBufEWMAWeight = 8
  constant framerBufShrinkThreshold (line 63) | framerBufShrinkThreshold = 2
  constant maxReasonableBufferSize (line 67) | maxReasonableBufferSize = 512 * 1024 * 1024
  constant maxCASRetries (line 71) | maxCASRetries = 100
  method initFramerCache (line 75) | func (c *Conn) initFramerCache() {
  method getReadFramer (line 123) | func (c *Conn) getReadFramer() *framer {
  method getWriteFramer (line 134) | func (c *Conn) getWriteFramer() *framer {
  method releaseReadFramer (line 146) | func (c *Conn) releaseReadFramer(f *framer) {
  method releaseWriteFramer (line 174) | func (c *Conn) releaseWriteFramer(f *framer) {
  function fpShrinkSize (line 276) | func fpShrinkSize(bufCap, newAvg int64) int64 {

FILE: framer_bench_test.go
  function readGzipData (line 37) | func readGzipData(path string) ([]byte, error) {
  function BenchmarkParseRowsFrame (line 53) | func BenchmarkParseRowsFrame(b *testing.B) {

FILE: helpers.go
  type RowData (line 39) | type RowData struct
    method rowMap (line 385) | func (r *RowData) rowMap(m map[string]any) {
  function asVectorType (line 46) | func asVectorType(t TypeInfo) (VectorType, bool) {
  function goType (line 84) | func goType(t TypeInfo) (reflect.Type, error) {
  function dereference (line 159) | func dereference(i any) any {
  function getCassandraLongType (line 206) | func getCassandraLongType(name string, protoVer byte, logger StdLogger) ...
  function splitJavaCompositeTypes (line 287) | func splitJavaCompositeTypes(name string, typeName string) []string {
  function unwrapCompositeTypeDefinition (line 291) | func unwrapCompositeTypeDefinition(name string, typeName string, typeOpe...
  function splitCompositeTypes (line 295) | func splitCompositeTypes(name string, typeName string, typeOpen int32, t...
  function getApacheCassandraType (line 328) | func getApacheCassandraType(class string) Type {
  function TupleColumnName (line 401) | func TupleColumnName(c string, n int) string {
  method RowData (line 406) | func (iter *Iter) RowData() (RowData, error) {
  method getScanColumns (line 432) | func (iter *Iter) getScanColumns() ([]string, error) {
  method newScanValues (line 475) | func (iter *Iter) newScanValues() ([]any, error) {
  method rowMap (line 521) | func (iter *Iter) rowMap() (map[string]any, error) {
  method SliceMap (line 539) | func (iter *Iter) SliceMap() ([]map[string]any, error) {
  method MapScan (line 607) | func (iter *Iter) MapScan(m map[string]any) bool {
  function copyBytes (line 630) | func copyBytes(p []byte) []byte {

FILE: helpers_bench_test.go
  function createMockIter (line 27) | func createMockIter(numColumns int) *Iter {
  function createMockIterWithTypes (line 49) | func createMockIterWithTypes() *Iter {
  function createMockIterWithTuples (line 74) | func createMockIterWithTuples() *Iter {
  function BenchmarkRowData (line 105) | func BenchmarkRowData(b *testing.B) {
  function BenchmarkRowDataSmall (line 121) | func BenchmarkRowDataSmall(b *testing.B) {
  function BenchmarkRowDataLarge (line 137) | func BenchmarkRowDataLarge(b *testing.B) {
  function BenchmarkRowDataWithTypes (line 153) | func BenchmarkRowDataWithTypes(b *testing.B) {
  function BenchmarkRowDataWithTuples (line 169) | func BenchmarkRowDataWithTuples(b *testing.B) {
  function BenchmarkRowDataRepeated (line 185) | func BenchmarkRowDataRepeated(b *testing.B) {
  function BenchmarkRowDataAllocation (line 204) | func BenchmarkRowDataAllocation(b *testing.B) {
  function BenchmarkDereference (line 232) | func BenchmarkDereference(b *testing.B) {
  function BenchmarkRowDataRepeatedCached (line 261) | func BenchmarkRowDataRepeatedCached(b *testing.B) {

FILE: host_source.go
  type nodeState (line 44) | type nodeState
    method String (line 46) | func (n nodeState) String() string {
  constant NodeUp (line 56) | NodeUp nodeState = iota
  constant NodeDown (line 57) | NodeDown
  type cassVersion (line 60) | type cassVersion struct
    method Set (line 67) | func (c *cassVersion) Set(v string) error {
    method UnmarshalCQL (line 75) | func (c *cassVersion) UnmarshalCQL(info TypeInfo, data []byte) error {
    method unmarshal (line 79) | func (c *cassVersion) unmarshal(data []byte) error {
    method Before (line 120) | func (c cassVersion) Before(major, minor, patch int) bool {
    method AtLeast (line 135) | func (c cassVersion) AtLeast(major, minor, patch int) bool {
    method String (line 139) | func (c cassVersion) String() string {
    method nodeUpDelay (line 146) | func (c cassVersion) nodeUpDelay() time.Duration {
  type AddressPort (line 155) | type AddressPort struct
    method Equal (line 160) | func (a AddressPort) Equal(o AddressPort) bool {
    method IsValid (line 164) | func (a AddressPort) IsValid() bool {
    method String (line 168) | func (a AddressPort) String() string {
    method ToNetAddr (line 172) | func (a AddressPort) ToNetAddr() string {
  type translatedAddresses (line 176) | type translatedAddresses struct
    method Equal (line 182) | func (h translatedAddresses) Equal(o *translatedAddresses) bool {
  type HostInfoBuilder (line 186) | type HostInfoBuilder struct
    method Build (line 208) | func (b HostInfoBuilder) Build() HostInfo {
  type HostInfo (line 241) | type HostInfo struct
    method Equal (line 269) | func (h *HostInfo) Equal(host *HostInfo) bool {
    method Peer (line 278) | func (h *HostInfo) Peer() net.IP {
    method invalidConnectAddr (line 284) | func (h *HostInfo) invalidConnectAddr() bool {
    method connectAddressLocked (line 295) | func (h *HostInfo) connectAddressLocked() (net.IP, string) {
    method getDriverFacingIpAddressLocked (line 313) | func (h *HostInfo) getDriverFacingIpAddressLocked() net.IP {
    method nodeToNodeAddress (line 330) | func (h *HostInfo) nodeToNodeAddress() net.IP {
    method ConnectAddress (line 344) | func (h *HostInfo) ConnectAddress() net.IP {
    method UntranslatedConnectAddress (line 354) | func (h *HostInfo) UntranslatedConnectAddress() net.IP {
    method BroadcastAddress (line 360) | func (h *HostInfo) BroadcastAddress() net.IP {
    method ListenAddress (line 366) | func (h *HostInfo) ListenAddress() net.IP {
    method RPCAddress (line 372) | func (h *HostInfo) RPCAddress() net.IP {
    method PreferredIP (line 378) | func (h *HostInfo) PreferredIP() net.IP {
    method DataCenter (line 384) | func (h *HostInfo) DataCenter() string {
    method Rack (line 391) | func (h *HostInfo) Rack() string {
    method HostID (line 398) | func (h *HostInfo) HostID() string {
    method hostUUID (line 409) | func (h *HostInfo) hostUUID() UUID {
    method WorkLoad (line 415) | func (h *HostInfo) WorkLoad() string {
    method Graph (line 421) | func (h *HostInfo) Graph() bool {
    method DSEVersion (line 427) | func (h *HostInfo) DSEVersion() string {
    method Partitioner (line 433) | func (h *HostInfo) Partitioner() string {
    method ClusterName (line 442) | func (h *HostInfo) ClusterName() string {
    method Version (line 448) | func (h *HostInfo) Version() cassVersion {
    method State (line 454) | func (h *HostInfo) State() nodeState {
    method setState (line 460) | func (h *HostInfo) setState(state nodeState) *HostInfo {
    method Tokens (line 467) | func (h *HostInfo) Tokens() []string {
    method Port (line 473) | func (h *HostInfo) Port() int {
    method update (line 479) | func (h *HostInfo) update(from *HostInfo) {
    method IsUp (line 541) | func (h *HostInfo) IsUp() bool {
    method IsBusy (line 545) | func (h *HostInfo) IsBusy(s *Session) bool {
    method ConnectAddressAndPort (line 552) | func (h *HostInfo) ConnectAddressAndPort() string {
    method String (line 559) | func (h *HostInfo) String() string {
    method setScyllaFeatures (line 572) | func (h *HostInfo) setScyllaFeatures(s ScyllaHostFeatures) {
    method ScyllaFeatures (line 578) | func (h *HostInfo) ScyllaFeatures() ScyllaHostFeatures {
    method ScyllaShardAwarePort (line 586) | func (h *HostInfo) ScyllaShardAwarePort() uint16 {
    method ScyllaShardAwarePortTLS (line 594) | func (h *HostInfo) ScyllaShardAwarePortTLS() uint16 {
    method ScyllaShardCount (line 601) | func (h *HostInfo) ScyllaShardCount() int {
    method setTranslatedConnectionInfo (line 607) | func (h *HostInfo) setTranslatedConnectionInfo(info translatedAddresse...
    method getTranslatedConnectionInfo (line 613) | func (h *HostInfo) getTranslatedConnectionInfo() *translatedAddresses {
  function validIpAddr (line 291) | func validIpAddr(addr net.IP) bool {
  function checkSystemSchema (line 620) | func checkSystemSchema(control controlConnection) (bool, error) {
  function hostInfoFromMap (line 641) | func hostInfoFromMap(row map[string]any, defaultPort int) (*HostInfo, er...
  function hostInfoFromIter (line 763) | func hostInfoFromIter(iter *Iter, defaultPort int) (*HostInfo, error) {
  method debounceRingRefresh (line 784) | func (s *Session) debounceRingRefresh() {
  method refreshRingNow (line 789) | func (s *Session) refreshRingNow() error {
  method refreshRing (line 798) | func (s *Session) refreshRing() error {

FILE: host_source_scylla.go
  method SetDatacenter (line 3) | func (h *HostInfo) SetDatacenter(dc string) {

FILE: host_source_test.go
  type trackingMockFramer (line 38) | type trackingMockFramer struct
    method Release (line 43) | func (f *trackingMockFramer) Release() {
  type systemSchemaTestControl (line 47) | type systemSchemaTestControl struct
    method getConn (line 51) | func (*systemSchemaTestControl) getConn() *connHost                   ...
    method awaitSchemaAgreement (line 52) | func (*systemSchemaTestControl) awaitSchemaAgreement() error          ...
    method query (line 53) | func (*systemSchemaTestControl) query(string, ...any) (iter *Iter)    ...
    method querySystem (line 54) | func (c *systemSchemaTestControl) querySystem(string, ...any) (iter *I...
    method discoverProtocol (line 55) | func (*systemSchemaTestControl) discoverProtocol([]*HostInfo) (int, er...
    method connect (line 56) | func (*systemSchemaTestControl) connect([]*HostInfo) error            ...
    method close (line 57) | func (*systemSchemaTestControl) close()                               ...
    method getSession (line 58) | func (*systemSchemaTestControl) getSession() *Session                 ...
    method reconnect (line 59) | func (*systemSchemaTestControl) reconnect() error                     ...
  function TestUnmarshalCassVersion (line 61) | func TestUnmarshalCassVersion(t *testing.T) {
  function TestCassVersionBefore (line 87) | func TestCassVersionBefore(t *testing.T) {
  function TestIsValidPeer (line 114) | func TestIsValidPeer(t *testing.T) {
  function TestIsZeroToken (line 135) | func TestIsZeroToken(t *testing.T) {
  function TestCheckSystemSchemaClosesIter (line 156) | func TestCheckSystemSchemaClosesIter(t *testing.T) {
  function TestHostInfoFromIterClosesIter (line 205) | func TestHostInfoFromIterClosesIter(t *testing.T) {
  function TestHostInfo_ConnectAddress (line 248) | func TestHostInfo_ConnectAddress(t *testing.T) {
  function TestAddressPort (line 281) | func TestAddressPort(t *testing.T) {
  function TestHostInfoBuilder (line 487) | func TestHostInfoBuilder(t *testing.T) {

FILE: hostpolicy/hostpool.go
  function HostPool (line 25) | func HostPool(hp hostpool.HostPool) gocql.HostSelectionPolicy {
  type hostPoolHostPolicy (line 29) | type hostPoolHostPolicy struct
    method Init (line 35) | func (r *hostPoolHostPolicy) Init(*gocql.Session)                     ...
    method Reset (line 36) | func (r *hostPoolHostPolicy) Reset()                                  ...
    method IsOperational (line 37) | func (r *hostPoolHostPolicy) IsOperational(*gocql.Session) error      ...
    method KeyspaceChanged (line 38) | func (r *hostPoolHostPolicy) KeyspaceChanged(gocql.KeyspaceUpdateEvent...
    method SetPartitioner (line 39) | func (r *hostPoolHostPolicy) SetPartitioner(string)                   ...
    method IsLocal (line 40) | func (r *hostPoolHostPolicy) IsLocal(*gocql.HostInfo) bool            ...
    method SetHosts (line 42) | func (r *hostPoolHostPolicy) SetHosts(hosts []*gocql.HostInfo) {
    method AddHost (line 58) | func (r *hostPoolHostPolicy) AddHost(host *gocql.HostInfo) {
    method RemoveHost (line 79) | func (r *hostPoolHostPolicy) RemoveHost(host *gocql.HostInfo) {
    method HostUp (line 98) | func (r *hostPoolHostPolicy) HostUp(host *gocql.HostInfo) {
    method HostDown (line 102) | func (r *hostPoolHostPolicy) HostDown(host *gocql.HostInfo) {
    method Pick (line 106) | func (r *hostPoolHostPolicy) Pick(qry gocql.ExecutableQuery) gocql.Nex...
  type selectedHostPoolHost (line 131) | type selectedHostPoolHost struct
    method Info (line 137) | func (host selectedHostPoolHost) Info() *gocql.HostInfo {
    method Token (line 141) | func (host selectedHostPoolHost) Token() gocql.Token {
    method Mark (line 145) | func (host selectedHostPoolHost) Mark(err error) {

FILE: hostpolicy/hostpool_test.go
  function TestHostPolicy_HostPool (line 14) | func TestHostPolicy_HostPool(t *testing.T) {

FILE: integration_only.go
  method MissingConnections (line 11) | func (p *policyConnPool) MissingConnections() (int, error) {
  method MissingConnections (line 28) | func (s *Session) MissingConnections() (int, error) {
  type ConnPickerIntegration (line 35) | type ConnPickerIntegration interface
  method CloseAllConnections (line 50) | func (p *scyllaConnPicker) CloseAllConnections() {
  method CloseAllConnections (line 58) | func (p *defaultConnPicker) CloseAllConnections() {
  method CloseAllConnections (line 63) | func (p *nopConnPicker) CloseAllConnections() {
  method CloseAllConnections (line 66) | func (pool *hostConnPool) CloseAllConnections() {
  method CloseAllConnections (line 78) | func (p *policyConnPool) CloseAllConnections() {
  method CloseAllConnections (line 88) | func (s *Session) CloseAllConnections() {

FILE: integration_serialization_scylla_test.go
  function TestSerializationSimpleTypesCassandra (line 21) | func TestSerializationSimpleTypesCassandra(t *testing.T) {
  function checkTypeMarshal (line 70) | func checkTypeMarshal(t *testing.T, tc valcases.SimpleTypeCases) {
  function checkTypeUnmarshal (line 92) | func checkTypeUnmarshal(t *testing.T, tc valcases.SimpleTypeCases) {
  function checkTypeInsertSelect (line 118) | func checkTypeInsertSelect(t *testing.T, session *Session, insertStmt, s...
  function newRef (line 167) | func newRef(in any) any {
  function deReference (line 172) | func deReference(in any) any {
  function equalVals (line 176) | func equalVals(in1, in2 any) bool {
  type SliceMapTypesTestCase (line 226) | type SliceMapTypesTestCase struct
  function compareCollectionValues (line 234) | func compareCollectionValues(t *testing.T, cqlType string, expected, act...
  function compareValues (line 267) | func compareValues(t *testing.T, cqlType string, expected, actual any) b...
  function TestSliceMapMapScanTypes (line 310) | func TestSliceMapMapScanTypes(t *testing.T) {
  function testSliceMapMapScanSimple (line 381) | func testSliceMapMapScanSimple(t *testing.T, session *Session, tc SliceM...
  function queryAndExtractValue (line 414) | func queryAndExtractValue(t *testing.T, session *Session, colName string...
  function validateResult (line 445) | func validateResult(t *testing.T, cqlType string, expected, actual any, ...
  function mustParseUUID (line 460) | func mustParseUUID(s string) UUID {
  function mustParseBigInt (line 468) | func mustParseBigInt(s string) *big.Int {
  function mustParseDecimal (line 476) | func mustParseDecimal(s string) *inf.Dec {
  function mustCreateDuration (line 484) | func mustCreateDuration(months int32, days int32, timeDuration time.Dura...
  function TestSliceMapMapScanCounterTypes (line 494) | func TestSliceMapMapScanCounterTypes(t *testing.T) {
  function TestSliceMapMapScanTupleTypes (line 557) | func TestSliceMapMapScanTupleTypes(t *testing.T) {
  function TestSliceMapMapScanVectorTypes (line 676) | func TestSliceMapMapScanVectorTypes(t *testing.T) {
  function TestSliceMapMapScanCollectionTypes (line 803) | func TestSliceMapMapScanCollectionTypes(t *testing.T) {

FILE: integration_test.go
  function init (line 42) | func init() {
  function TestAuthentication (line 49) | func TestAuthentication(t *testing.T) {
  function TestGetHostsFromSystem (line 72) | func TestGetHostsFromSystem(t *testing.T) {
  function TestRingDiscovery (line 88) | func TestRingDiscovery(t *testing.T) {
  function TestHostFilterDiscovery (line 117) | func TestHostFilterDiscovery(t *testing.T) {
  function TestHostFilterInitial (line 144) | func TestHostFilterInitial(t *testing.T) {
  function TestApplicationInformation (line 168) | func TestApplicationInformation(t *testing.T) {
  function TestWriteFailure (line 273) | func TestWriteFailure(t *testing.T) {
  function TestCustomPayloadMessages (line 317) | func TestCustomPayloadMessages(t *testing.T) {
  function TestCustomPayloadValues (line 359) | func TestCustomPayloadValues(t *testing.T) {
  function TestSessionAwaitSchemaAgreement (line 385) | func TestSessionAwaitSchemaAgreement(t *testing.T) {
  function TestSessionAwaitSchemaAgreementSessionClosed (line 396) | func TestSessionAwaitSchemaAgreementSessionClosed(t *testing.T) {
  function TestSessionAwaitSchemaAgreementContextCanceled (line 408) | func TestSessionAwaitSchemaAgreementContextCanceled(t *testing.T) {
  function TestNewConnectWithLowTimeout (line 421) | func TestNewConnectWithLowTimeout(t *testing.T) {

FILE: internal/ccm/ccm.go
  function execCmd (line 40) | func execCmd(args ...string) (*bytes.Buffer, error) {
  function AllUp (line 57) | func AllUp() error {
  function NodeUp (line 74) | func NodeUp(node string) error {
  function NodeDown (line 83) | func NodeDown(node string) error {
  type Host (line 88) | type Host struct
  type NodeState (line 94) | type NodeState
    method String (line 96) | func (n NodeState) String() string {
    method IsUp (line 106) | func (n NodeState) IsUp() bool {
  constant NodeStateUp (line 111) | NodeStateUp NodeState = iota
  constant NodeStateDown (line 112) | NodeStateDown
  function Status (line 115) | func Status() (map[string]Host, error) {

FILE: internal/ccm/ccm_test.go
  function TestCCM (line 34) | func TestCCM(t *testing.T) {

FILE: internal/debug/debug_off.go
  constant Enabled (line 30) | Enabled = false

FILE: internal/debug/debug_on.go
  constant Enabled (line 30) | Enabled = true

FILE: internal/eventbus/eventbus.go
  type FilterFunc (line 44) | type FilterFunc
  type subscriber (line 47) | type subscriber struct
  type Subscriber (line 55) | type Subscriber struct
  method Events (line 63) | func (s *Subscriber[T]) Events() <-chan T {
  method Stop (line 68) | func (s *Subscriber[T]) Stop() error {
  type status (line 72) | type status
  constant statusInitialized (line 75) | statusInitialized status = iota
  constant statusStarted (line 76) | statusStarted
  constant statusStopped (line 77) | statusStopped
  type EventBus (line 81) | type EventBus struct
  type StdLogger (line 92) | type StdLogger interface
  type EventBusConfig (line 98) | type EventBusConfig struct
  function New (line 105) | func New[T any](cfg EventBusConfig, logger StdLogger) *EventBus[T] {
  method Start (line 117) | func (eb *EventBus[T]) Start() error {
  method Stop (line 140) | func (eb *EventBus[T]) Stop() error {
  method PublishEvent (line 167) | func (eb *EventBus[T]) PublishEvent(e T) bool {
  method PublishEventBlocking (line 177) | func (eb *EventBus[T]) PublishEventBlocking(e T) {
  method Subscribe (line 189) | func (eb *EventBus[T]) Subscribe(name string, queueSize int, filter Filt...
  method remove (line 209) | func (eb *EventBus[T]) remove(s *Subscriber[T]) error {
  method SubscriberCount (line 231) | func (eb *EventBus[T]) SubscriberCount() int {
  method run (line 238) | func (eb *EventBus[T]) run() {
  method distribute (line 258) | func (eb *EventBus[T]) distribute(event T) {
  method SubscribeWithContext (line 281) | func (eb *EventBus[T]) SubscribeWithContext(ctx context.Context, name st...
  method String (line 294) | func (eb *EventBus[T]) String() string {

FILE: internal/eventbus/eventbus_test.go
  function TestNew (line 31) | func TestNew(t *testing.T) {
  function TestStartStop (line 50) | func TestStartStop(t *testing.T) {
  function TestStopWithoutStart (line 81) | func TestStopWithoutStart(t *testing.T) {
  function TestEventDistribution (line 92) | func TestEventDistribution(t *testing.T) {
  function TestEventFiltering (line 133) | func TestEventFiltering(t *testing.T) {
  function TestSubscriberCount (line 203) | func TestSubscriberCount(t *testing.T) {
  function TestConcurrentSubscribers (line 232) | func TestConcurrentSubscribers(t *testing.T) {
  function TestSubscribeWithContext (line 287) | func TestSubscribeWithContext(t *testing.T) {
  function TestChannelClosedOnStop (line 330) | func TestChannelClosedOnStop(t *testing.T) {
  function TestSubscriberStopAfterEventBusStop (line 361) | func TestSubscriberStopAfterEventBusStop(t *testing.T) {
  function TestChannelClosedOnUnsubscribe (line 390) | func TestChannelClosedOnUnsubscribe(t *testing.T) {
  function TestString (line 423) | func TestString(t *testing.T) {
  function TestSlowSubscriberDoesNotBlockBus (line 440) | func TestSlowSubscriberDoesNotBlockBus(t *testing.T) {
  function BenchmarkEventDistribution (line 498) | func BenchmarkEventDistribution(b *testing.B) {
  function BenchmarkEventDistributionWithFilter (line 517) | func BenchmarkEventDistributionWithFilter(b *testing.B) {

FILE: internal/eventbus/example_test.go
  function Example (line 30) | func Example() {
  function Example_withContext (line 91) | func Example_withContext() {
  function Example_multipleSubscribers (line 133) | func Example_multipleSubscribers() {
  function Example_unsubscribe (line 200) | func Example_unsubscribe() {

FILE: internal/frame/frames.go
  constant protoDirectionMask (line 33) | protoDirectionMask = 0x80
  constant protoVersionMask (line 34) | protoVersionMask   = 0x7F
  constant protoVersion1 (line 35) | protoVersion1      = 0x01
  constant protoVersion2 (line 36) | protoVersion2      = 0x02
  constant protoVersion3 (line 37) | protoVersion3      = 0x03
  constant protoVersion4 (line 38) | protoVersion4      = 0x04
  constant protoVersion5 (line 39) | protoVersion5      = 0x05
  constant maxFrameSize (line 41) | maxFrameSize = 256 * 1024 * 1024
  constant ResultKindVoid (line 46) | ResultKindVoid          = 1
  constant ResultKindRows (line 47) | ResultKindRows          = 2
  constant ResultKindKeyspace (line 48) | ResultKindKeyspace      = 3
  constant ResultKindPrepared (line 49) | ResultKindPrepared      = 4
  constant ResultKindSchemaChanged (line 50) | ResultKindSchemaChanged = 5
  constant FlagGlobalTableSpec (line 53) | FlagGlobalTableSpec int = 0x01
  constant FlagHasMorePages (line 54) | FlagHasMorePages    int = 0x02
  constant FlagNoMetaData (line 55) | FlagNoMetaData      int = 0x04
  constant FlagValues (line 58) | FlagValues                byte = 0x01
  constant FlagSkipMetaData (line 59) | FlagSkipMetaData          byte = 0x02
  constant FlagPageSize (line 60) | FlagPageSize              byte = 0x04
  constant FlagWithPagingState (line 61) | FlagWithPagingState       byte = 0x08
  constant FlagWithSerialConsistency (line 62) | FlagWithSerialConsistency byte = 0x10
  constant FlagDefaultTimestamp (line 63) | FlagDefaultTimestamp      byte = 0x20
  constant FlagWithNameValues (line 64) | FlagWithNameValues        byte = 0x40
  constant FlagWithKeyspace (line 65) | FlagWithKeyspace          byte = 0x80
  constant FlagWithPreparedKeyspace (line 68) | FlagWithPreparedKeyspace uint32 = 0x01
  constant FlagCompress (line 71) | FlagCompress      byte = 0x01
  constant FlagTracing (line 72) | FlagTracing       byte = 0x02
  constant FlagCustomPayload (line 73) | FlagCustomPayload byte = 0x04
  constant FlagWarning (line 74) | FlagWarning       byte = 0x08
  constant FlagBetaProtocol (line 75) | FlagBetaProtocol  byte = 0x10
  type ProtoVersion (line 78) | type ProtoVersion
    method Request (line 80) | func (p ProtoVersion) Request() bool {
    method Response (line 84) | func (p ProtoVersion) Response() bool {
    method Version (line 88) | func (p ProtoVersion) Version() byte {
    method String (line 92) | func (p ProtoVersion) String() string {
  type Op (line 101) | type Op
    method String (line 123) | func (f Op) String() string {
  constant OpError (line 105) | OpError         Op = 0x00
  constant OpStartup (line 106) | OpStartup       Op = 0x01
  constant OpReady (line 107) | OpReady         Op = 0x02
  constant OpAuthenticate (line 108) | OpAuthenticate  Op = 0x03
  constant OpOptions (line 109) | OpOptions       Op = 0x05
  constant OpSupported (line 110) | OpSupported     Op = 0x06
  constant OpQuery (line 111) | OpQuery         Op = 0x07
  constant OpResult (line 112) | OpResult        Op = 0x08
  constant OpPrepare (line 113) | OpPrepare       Op = 0x09
  constant OpExecute (line 114) | OpExecute       Op = 0x0A
  constant OpRegister (line 115) | OpRegister      Op = 0x0B
  constant OpEvent (line 116) | OpEvent         Op = 0x0C
  constant OpBatch (line 117) | OpBatch         Op = 0x0D
  constant OpAuthChallenge (line 118) | OpAuthChallenge Op = 0x0E
  constant OpAuthResponse (line 119) | OpAuthResponse  Op = 0x0F
  constant OpAuthSuccess (line 120) | OpAuthSuccess   Op = 0x10
  type FrameHeader (line 162) | type FrameHeader struct
    method String (line 171) | func (f FrameHeader) String() string {
    method Header (line 175) | func (f FrameHeader) Header() FrameHeader {
  type Frame (line 179) | type Frame interface
  type ReadyFrame (line 183) | type ReadyFrame struct
  type SupportedFrame (line 187) | type SupportedFrame struct
  type SchemaChangeKeyspace (line 192) | type SchemaChangeKeyspace struct
    method String (line 198) | func (f SchemaChangeKeyspace) String() string {
  type SchemaChangeTable (line 202) | type SchemaChangeTable struct
    method String (line 209) | func (f SchemaChangeTable) String() string {
  type SchemaChangeType (line 213) | type SchemaChangeType struct
  type SchemaChangeFunction (line 220) | type SchemaChangeFunction struct
  type SchemaChangeAggregate (line 228) | type SchemaChangeAggregate struct
  type ClientRoutesChanged (line 236) | type ClientRoutesChanged struct
  type AuthenticateFrame (line 243) | type AuthenticateFrame struct
    method String (line 248) | func (a *AuthenticateFrame) String() string {
  type AuthSuccessFrame (line 252) | type AuthSuccessFrame struct
    method String (line 257) | func (a *AuthSuccessFrame) String() string {
  type AuthChallengeFrame (line 261) | type AuthChallengeFrame struct
    method String (line 266) | func (a *AuthChallengeFrame) String() string {
  type StatusChangeEventFrame (line 270) | type StatusChangeEventFrame struct
    method String (line 277) | func (t StatusChangeEventFrame) String() string {
  type TopologyChangeEventFrame (line 282) | type TopologyChangeEventFrame struct
    method String (line 289) | func (t TopologyChangeEventFrame) String() string {
  type ErrorFrame (line 293) | type ErrorFrame struct
    method GetCode (line 299) | func (e ErrorFrame) GetCode() int {
    method GetMessage (line 303) | func (e ErrorFrame) GetMessage() string {
    method Error (line 307) | func (e ErrorFrame) Error() string {
    method String (line 311) | func (e ErrorFrame) String() string {

FILE: internal/lru/lru.go
  type Cache (line 52) | type Cache struct
  type entry (line 63) | type entry struct
  function New (line 71) | func New[K comparable](maxEntries int) *Cache[K] {
  method Add (line 80) | func (c *Cache[K]) Add(key K, value any) {
  method Get (line 98) | func (c *Cache[K]) Get(key K) (value any, ok bool) {
  method Remove (line 110) | func (c *Cache[K]) Remove(key K) bool {
  method RemoveOldest (line 124) | func (c *Cache[K]) RemoveOldest() {
  method removeElement (line 134) | func (c *Cache[K]) removeElement(e *list.Element) {
  method Len (line 144) | func (c *Cache[K]) Len() int {

FILE: internal/lru/lru_test.go
  function TestGet (line 64) | func TestGet(t *testing.T) {
  function TestRemove (line 79) | func TestRemove(t *testing.T) {
  function TestStructKey (line 97) | func TestStructKey(t *testing.T) {
  type stmtKey (line 126) | type stmtKey struct
  function BenchmarkStructKeyLookup (line 134) | func BenchmarkStructKeyLookup(b *testing.B) {
  function BenchmarkStringKeyLookup (line 151) | func BenchmarkStringKeyLookup(b *testing.B) {
  function BenchmarkStructKeyInsert (line 164) | func BenchmarkStructKeyInsert(b *testing.B) {
  function BenchmarkStringKeyInsert (line 180) | func BenchmarkStringKeyInsert(b *testing.B) {

FILE: internal/murmur/murmur.go
  constant c1 (line 28) | c1    int64 = -8663945395140668459
  constant c2 (line 29) | c2    int64 = 5545529020109919103
  constant fmix1 (line 30) | fmix1 int64 = -49064778989728563
  constant fmix2 (line 31) | fmix2 int64 = -4265267296055464877
  function fmix (line 34) | func fmix(n int64) int64 {
  function block (line 45) | func block(p byte) int64 {
  function rotl (line 49) | func rotl(x int64, r uint8) int64 {
  function Murmur3H1 (line 54) | func Murmur3H1(data []byte) int64 {

FILE: internal/murmur/murmur_appengine.go
  function getBlock (line 32) | func getBlock(data []byte, n int) (int64, int64) {

FILE: internal/murmur/murmur_test.go
  function TestRotl (line 37) | func TestRotl(t *testing.T) {
  function TestFmix (line 64) | func TestFmix(t *testing.T) {
  function TestMurmur3H1_CassandraSign (line 87) | func TestMurmur3H1_CassandraSign(t *testing.T) {
  function TestMurmur3H1 (line 103) | func TestMurmur3H1(t *testing.T) {
  function assertMurmur3H1 (line 147) | func assertMurmur3H1(t *testing.T, data []byte, expected uint64) {
  function BenchmarkMurmur3H1 (line 155) | func BenchmarkMurmur3H1(b *testing.B) {

FILE: internal/murmur/murmur_unsafe.go
  function getBlock (line 34) | func getBlock(data []byte, n int) (int64, int64) {

FILE: internal/streams/streams.go
  constant bucketBits (line 33) | bucketBits = 64
  type IDGenerator (line 36) | type IDGenerator struct
    method GetStream (line 71) | func (s *IDGenerator) GetStream() (int, bool) {
    method isSet (line 116) | func (s *IDGenerator) isSet(stream int) bool {
    method String (line 121) | func (s *IDGenerator) String() string {
    method Clear (line 132) | func (s *IDGenerator) Clear(stream int) (inuse bool) {
    method Available (line 159) | func (s *IDGenerator) Available() int {
    method InUse (line 163) | func (s *IDGenerator) InUse() int {
  function New (line 45) | func New() *IDGenerator {
  function NewLimited (line 49) | func NewLimited(maxStreams int) *IDGenerator {
  function streamFromBucket (line 67) | func streamFromBucket(bucket, streamInBucket int) int {
  function bitfmt (line 99) | func bitfmt(b uint64) string {
  function bucketOffset (line 104) | func bucketOffset(i int) int {
  function streamOffset (line 108) | func streamOffset(stream int) uint64 {
  function isSet (line 112) | func isSet(bits uint64, stream int) bool {

FILE: internal/streams/streams_test.go
  function TestUsesAllStreams (line 37) | func TestUsesAllStreams(t *testing.T) {
  function TestFullStreams (line 78) | func TestFullStreams(t *testing.T) {
  function TestClearStreams (line 92) | func TestClearStreams(t *testing.T) {
  function TestDoubleClear (line 112) | func TestDoubleClear(t *testing.T) {
  function BenchmarkConcurrentUse (line 129) | func BenchmarkConcurrentUse(b *testing.B) {
  function TestStreamOffset (line 148) | func TestStreamOffset(t *testing.T) {
  function TestIsSet (line 172) | func TestIsSet(t *testing.T) {
  function TestBucketOfset (line 203) | func TestBucketOfset(t *testing.T) {
  function TestStreamFromBucket (line 223) | func TestStreamFromBucket(t *testing.T) {

FILE: internal/tests/common.go
  function AssertTrue (line 12) | func AssertTrue(t *testing.T, description string, value bool) {
  function AssertEqual (line 19) | func AssertEqual(t *testing.T, description string, expected, actual any) {
  function AssertDeepEqual (line 26) | func AssertDeepEqual(t *testing.T, description string, expected, actual ...
  function AssertNil (line 33) | func AssertNil(t *testing.T, description string, actual any) {
  function RandomUUID (line 40) | func RandomUUID() string {
  function GenerateHostNames (line 58) | func GenerateHostNames(hostCount int) []string {

FILE: internal/tests/err_equal.go
  function ErrEqual (line 3) | func ErrEqual(err1, err2 error) bool {

FILE: internal/tests/mock/mock_framer.go
  type MockFramer (line 3) | type MockFramer struct
    method ReadBytesInternal (line 8) | func (m *MockFramer) ReadBytesInternal() ([]byte, error) {
    method GetCustomPayload (line 16) | func (*MockFramer) GetCustomPayload() map[string][]byte { return map[s...
    method GetHeaderWarnings (line 17) | func (*MockFramer) GetHeaderWarnings() []string         { return []str...
    method Release (line 18) | func (*MockFramer) Release()                            {}

FILE: internal/tests/rand.go
  type RandInterface (line 11) | type RandInterface interface
  function RandomTokens (line 37) | func RandomTokens(rnd RandInterface, n int) []int64 {
  function ShuffledIndexes (line 56) | func ShuffledIndexes(rnd RandInterface, n int) []int {
  type ThreadSafeRand (line 70) | type ThreadSafeRand struct
    method Uint64 (line 83) | func (r *ThreadSafeRand) Uint64() uint64 {
    method Uint32 (line 89) | func (r *ThreadSafeRand) Uint32() uint32 {
    method Int (line 95) | func (r *ThreadSafeRand) Int() int {
    method Intn (line 101) | func (r *ThreadSafeRand) Intn(n int) int {
    method Int63 (line 107) | func (r *ThreadSafeRand) Int63() int64 {
    method Int63n (line 113) | func (r *ThreadSafeRand) Int63n(n int64) int64 {
    method Int31 (line 119) | func (r *ThreadSafeRand) Int31() int32 {
    method Int31n (line 125) | func (r *ThreadSafeRand) Int31n(n int32) int32 {
    method Float64 (line 131) | func (r *ThreadSafeRand) Float64() float64 {
    method Float32 (line 137) | func (r *ThreadSafeRand) Float32() float32 {
    method ExpFloat64 (line 143) | func (r *ThreadSafeRand) ExpFloat64() float64 {
    method NormFloat64 (line 149) | func (r *ThreadSafeRand) NormFloat64() float64 {
    method Shuffle (line 155) | func (r *ThreadSafeRand) Shuffle(n int, swap func(i, j int)) {
    method Read (line 161) | func (r *ThreadSafeRand) Read(p []byte) (n int, err error) {
  function NewThreadSafeRand (line 77) | func NewThreadSafeRand(seed int64) *ThreadSafeRand {
  constant randCharset (line 169) | randCharset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234...
  function RandomText (line 171) | func RandomText(size int) string {

FILE: internal/tests/serialization/mod/all.go
  type Mod (line 6) | type Mod
  type Values (line 8) | type Values
    method AddVariants (line 10) | func (v Values) AddVariants(mods ...Mod) Values {

FILE: internal/tests/serialization/mod/custom.go
  type Bool (line 4) | type Bool
  type Int8 (line 6) | type Int8
  type Int16 (line 7) | type Int16
  type Int32 (line 8) | type Int32
  type Int64 (line 9) | type Int64
  type Int (line 10) | type Int
  type Uint8 (line 12) | type Uint8
  type Uint16 (line 13) | type Uint16
  type Uint32 (line 14) | type Uint32
  type Uint64 (line 15) | type Uint64
  type Uint (line 16) | type Uint
  type Float32 (line 18) | type Float32
  type Float64 (line 19) | type Float64
  type String (line 21) | type String
  type Bytes (line 23) | type Bytes
  type Bytes3 (line 24) | type Bytes3
  type Bytes4 (line 25) | type Bytes4
  type Bytes5 (line 26) | type Bytes5
  type Bytes15 (line 27) | type Bytes15
  type Bytes16 (line 28) | type Bytes16
  type Bytes17 (line 29) | type Bytes17
  type SliceInt16 (line 31) | type SliceInt16
  type SliceInt16R (line 32) | type SliceInt16R
  type SliceInt16C (line 33) | type SliceInt16C
  type SliceInt16CR (line 34) | type SliceInt16CR
  type SliceInt32 (line 36) | type SliceInt32
  type SliceInt32R (line 37) | type SliceInt32R
  type SliceInt32C (line 38) | type SliceInt32C
  type SliceInt32CR (line 39) | type SliceInt32CR
  type SliceAny (line 41) | type SliceAny
  type Arr1Int16 (line 43) | type Arr1Int16
  type Arr1Int16R (line 44) | type Arr1Int16R
  type Arr1Int16C (line 45) | type Arr1Int16C
  type Arr1Int16CR (line 46) | type Arr1Int16CR
  type Arr1Int32 (line 48) | type Arr1Int32
  type Arr1Int32R (line 49) | type Arr1Int32R
  type Arr1Int32C (line 50) | type Arr1Int32C
  type Arr1Int32CR (line 51) | type Arr1Int32CR
  type ArrAny (line 53) | type ArrAny
  type MapInt16 (line 55) | type MapInt16
  type MapInt16R (line 56) | type MapInt16R
  type MapInt16C (line 57) | type MapInt16C
  type MapInt16CR (line 58) | type MapInt16CR
  type MapInt32 (line 60) | type MapInt32
  type MapInt32R (line 61) | type MapInt32R
  type MapInt32C (line 62) | type MapInt32C
  type MapInt32CR (line 63) | type MapInt32CR
  type MapUDT (line 65) | type MapUDT
  function customType (line 82) | func customType(i any) any {
  function intoCustomR (line 185) | func intoCustomR(i any) any {

FILE: internal/tests/serialization/mod/refs.go
  function reference (line 15) | func reference(val any) any {

FILE: internal/tests/serialization/pointers.go
  function getPointers (line 18) | func getPointers(i any) *pointer {
  type pointer (line 33) | type pointer struct
    method NotNil (line 38) | func (p *pointer) NotNil() bool {
    method Valid (line 45) | func (p *pointer) Valid(v any) error {

FILE: internal/tests/serialization/pointers_test.go
  function Test1Pointers (line 8) | func Test1Pointers(t *testing.T) {
  function Test2Pointers (line 27) | func Test2Pointers(t *testing.T) {

FILE: internal/tests/serialization/set_negative_marshal.go
  type NegativeMarshalSet (line 11) | type NegativeMarshalSet struct
    method Run (line 16) | func (s NegativeMarshalSet) Run(name string, t *testing.T, marshal fun...

FILE: internal/tests/serialization/set_negative_unmarshal.go
  type NegativeUnmarshalSet (line 13) | type NegativeUnmarshalSet struct
    method Run (line 19) | func (s NegativeUnmarshalSet) Run(name string, t *testing.T, unmarshal...
    method run (line 46) | func (s NegativeUnmarshalSet) run(name string, t *testing.T, f func([]...

FILE: internal/tests/serialization/set_positive.go
  type PositiveSet (line 15) | type PositiveSet struct
    method Run (line 23) | func (s PositiveSet) Run(name string, t *testing.T, marshal func(any) ...
    method runMarshalTest (line 56) | func (s PositiveSet) runMarshalTest(t *testing.T, f func(any) ([]byte,...
    method runUnmarshalTest (line 89) | func (s PositiveSet) runUnmarshalTest(name string, t *testing.T, f fun...

FILE: internal/tests/serialization/utils.go
  function GetTypes (line 7) | func GetTypes(values ...any) []reflect.Type {
  function isTypeOf (line 15) | func isTypeOf(value any, types []reflect.Type) bool {
  function deReference (line 25) | func deReference(in any) any {

FILE: internal/tests/serialization/utils_equal.go
  function equalData (line 15) | func equalData(in1, in2 []byte) bool {
  function equalVals (line 22) | func equalVals(in1, in2 any) bool {

FILE: internal/tests/serialization/utils_error.go
  type unequalError (line 11) | type unequalError struct
    method Error (line 16) | func (e unequalError) Error() string {
  type panicErr (line 20) | type panicErr struct
    method Error (line 25) | func (e panicErr) Error() string {

FILE: internal/tests/serialization/utils_new.go
  function newRef (line 7) | func newRef(in any) any {
  function newRefToZero (line 12) | func newRefToZero(in any) any {

FILE: internal/tests/serialization/utils_str.go
  constant printLimit (line 13) | printLimit = 100
  function stringValue (line 16) | func stringValue(in any) string {
  function stringData (line 24) | func stringData(p []byte) string {
  function stringVal (line 34) | func stringVal(in any) string {

FILE: internal/tests/serialization/valcases/get.go
  type SimpleTypes (line 7) | type SimpleTypes
  type SimpleTypeCases (line 9) | type SimpleTypeCases struct
  type SimpleTypeCase (line 15) | type SimpleTypeCase struct
  type LangCase (line 21) | type LangCase struct
  function GetSimple (line 30) | func GetSimple() SimpleTypes {
  function nilRef (line 34) | func nilRef(in any) any {

FILE: keyspace_table_test.go
  function TestKeyspaceTable (line 39) | func TestKeyspaceTable(t *testing.T) {

FILE: logger.go
  type StdLogger (line 33) | type StdLogger interface
  type nopLogger (line 39) | type nopLogger struct
    method Print (line 41) | func (n nopLogger) Print(_ ...any) {}
    method Printf (line 43) | func (n nopLogger) Printf(_ string, _ ...any) {}
    method Println (line 45) | func (n nopLogger) Println(_ ...any) {}
  type testLogger (line 47) | type testLogger struct
    method Print (line 51) | func (l *testLogger) Print(v ...any)                 { fmt.Fprint(&l.c...
    method Printf (line 52) | func (l *testLogger) Printf(format string, v ...any) { fmt.Fprintf(&l....
    method Println (line 53) | func (l *testLogger) Println(v ...any)               { fmt.Fprintln(&l...
    method String (line 54) | func (l *testLogger) String() string                 { return l.captur...
  type defaultLogger (line 56) | type defaultLogger struct
    method Print (line 58) | func (l *defaultLogger) Print(v ...any)                 { log.Print(v....
    method Printf (line 59) | func (l *defaultLogger) Printf(format string, v ...any) { log.Printf(f...
    method Println (line 60) | func (l *defaultLogger) Println(v ...any)               { log.Println(...

FILE: lz4/lz4.go
  type LZ4Compressor (line 44) | type LZ4Compressor struct
    method Name (line 46) | func (s LZ4Compressor) Name() string {
    method Encode (line 50) | func (s LZ4Compressor) Encode(data []byte) ([]byte, error) {
    method Decode (line 64) | func (s LZ4Compressor) Decode(data []byte) ([]byte, error) {

FILE: lz4/lz4_bench_test.go
  function BenchmarkLZ4Compressor (line 10) | func BenchmarkLZ4Compressor(b *testing.B) {

FILE: lz4/lz4_test.go
  function TestLZ4Compressor (line 36) | func TestLZ4Compressor(t *testing.T) {

FILE: marshal.go
  type Marshaler (line 83) | type Marshaler interface
  type DirectMarshal (line 87) | type DirectMarshal
    method MarshalCQL (line 89) | func (m DirectMarshal) MarshalCQL(_ TypeInfo) ([]byte, error) {
  type Unmarshaler (line 109) | type Unmarshaler interface
  type DirectUnmarshal (line 113) | type DirectUnmarshal
    method UnmarshalCQL (line 115) | func (d *DirectUnmarshal) UnmarshalCQL(_ TypeInfo, data []byte) error {
  function Marshal (line 171) | func Marshal(info TypeInfo, value any) ([]byte, error) {
  function Unmarshal (line 292) | func Unmarshal(info TypeInfo, data []byte, value any) error {
  function isNullableValue (line 362) | func isNullableValue(value any) bool {
  function isNullData (line 367) | func isNullData(info TypeInfo, data []byte) bool {
  function unmarshalNullable (line 371) | func unmarshalNullable(info TypeInfo, data []byte, value any) error {
  function marshalVarchar (line 385) | func marshalVarchar(value any) ([]byte, error) {
  function marshalText (line 393) | func marshalText(value any) ([]byte, error) {
  function marshalBlob (line 401) | func marshalBlob(value any) ([]byte, error) {
  function marshalAscii (line 409) | func marshalAscii(value any) ([]byte, error) {
  function unmarshalVarchar (line 417) | func unmarshalVarchar(data []byte, value any) error {
  function unmarshalText (line 425) | func unmarshalText(data []byte, value any) error {
  function unmarshalBlob (line 433) | func unmarshalBlob(data []byte, value any) error {
  function unmarshalAscii (line 441) | func unmarshalAscii(data []byte, value any) error {
  function marshalSmallInt (line 449) | func marshalSmallInt(value any) ([]byte, error) {
  function marshalTinyInt (line 457) | func marshalTinyInt(value any) ([]byte, error) {
  function marshalInt (line 465) | func marshalInt(value any) ([]byte, error) {
  function marshalBigInt (line 473) | func marshalBigInt(value any) ([]byte, error) {
  function marshalCounter (line 481) | func marshalCounter(value any) ([]byte, error) {
  function unmarshalCounter (line 489) | func unmarshalCounter(data []byte, value any) error {
  function unmarshalInt (line 497) | func unmarshalInt(data []byte, value any) error {
  function unmarshalBigInt (line 505) | func unmarshalBigInt(data []byte, value any) error {
  function unmarshalSmallInt (line 513) | func unmarshalSmallInt(data []byte, value any) error {
  function unmarshalTinyInt (line 521) | func unmarshalTinyInt(data []byte, value any) error {
  function unmarshalVarint (line 528) | func unmarshalVarint(data []byte, value any) error {
  function marshalVarint (line 535) | func marshalVarint(value any) ([]byte, error) {
  function marshalBool (line 543) | func marshalBool(value any) ([]byte, error) {
  function unmarshalBool (line 551) | func unmarshalBool(data []byte, value any) error {
  function marshalFloat (line 558) | func marshalFloat(value any) ([]byte, error) {
  function unmarshalFloat (line 566) | func unmarshalFloat(data []byte, value any) error {
  function marshalDouble (line 573) | func marshalDouble(value any) ([]byte, error) {
  function unmarshalDouble (line 581) | func unmarshalDouble(data []byte, value any) error {
  function marshalDecimal (line 589) | func marshalDecimal(value any) ([]byte, error) {
  function unmarshalDecimal (line 597) | func unmarshalDecimal(data []byte, value any) error {
  function marshalTime (line 604) | func marshalTime(value any) ([]byte, error) {
  function unmarshalTime (line 612) | func unmarshalTime(data []byte, value any) error {
  function marshalTimestamp (line 620) | func marshalTimestamp(value any) ([]byte, error) {
  function unmarshalTimestamp (line 628) | func unmarshalTimestamp(data []byte, value any) error {
  function marshalDate (line 636) | func marshalDate(value any) ([]byte, error) {
  function unmarshalDate (line 644) | func unmarshalDate(data []byte, value any) error {
  function marshalDuration (line 652) | func marshalDuration(value any) ([]byte, error) {
  function unmarshalDuration (line 666) | func unmarshalDuration(data []byte, value any) error {
  function writeCollectionSize (line 684) | func writeCollectionSize(info CollectionType, n int, buf *bytes.Buffer) ...
  function marshalList (line 697) | func marshalList(info TypeInfo, value any) ([]byte, error) {
  function readCollectionSize (line 755) | func readCollectionSize(info CollectionType, data []byte) (size, read in...
  function unmarshalList (line 764) | func unmarshalList(info TypeInfo, data []byte, value any) error {
  function marshalVector (line 844) | func marshalVector(info VectorType, value any) ([]byte, error) {
  function unmarshalVector (line 889) | func unmarshalVector(info VectorType, data []byte, value any) error {
  function vectorFixedElemSize (line 972) | func vectorFixedElemSize(elemType TypeInfo) int {
  function isVectorVariableLengthType (line 1006) | func isVectorVariableLengthType(elemType TypeInfo) bool {
  function writeUnsignedVInt (line 1024) | func writeUnsignedVInt(buf *bytes.Buffer, v uint64) {
  function readUnsignedVInt (line 1041) | func readUnsignedVInt(data []byte) (uint64, int, error) {
  function computeUnsignedVIntSize (line 1061) | func computeUnsignedVIntSize(v uint64) int {
  function marshalMap (line 1066) | func marshalMap(info TypeInfo, value any) ([]byte, error) {
  function unmarshalMap (line 1129) | func unmarshalMap(info TypeInfo, data []byte, value any) error {
  function marshalUUID (line 1224) | func marshalUUID(value any) ([]byte, error) {
  function unmarshalUUID (line 1238) | func unmarshalUUID(data []byte, value any) error {
  function marshalTimeUUID (line 1256) | func marshalTimeUUID(value any) ([]byte, error) {
  function unmarshalTimeUUID (line 1270) | func unmarshalTimeUUID(data []byte, value any) error {
  function marshalInet (line 1288) | func marshalInet(value any) ([]byte, error) {
  function unmarshalInet (line 1296) | func unmarshalInet(data []byte, value any) error {
  function marshalTuple (line 1304) | func marshalTuple(info TypeInfo, value any) ([]byte, error) {
  function readBytes (line 1395) | func readBytes(p []byte) ([]byte, []byte) {
  function unmarshalTuple (line 1408) | func unmarshalTuple(info TypeInfo, data []byte, value any) error {
  type UDTMarshaler (line 1518) | type UDTMarshaler interface
  type UDTUnmarshaler (line 1527) | type UDTUnmarshaler interface
  function marshalUDT (line 1538) | func marshalUDT(info TypeInfo, value any) ([]byte, error) {
  function unmarshalUDT (line 1622) | func unmarshalUDT(info TypeInfo, data []byte, value any) error {
  type TypeInfo (line 1757) | type TypeInfo interface
  type NativeType (line 1769) | type NativeType struct
    method NewWithError (line 1784) | func (t NativeType) NewWithError() (any, error) {
    method Type (line 1827) | func (t NativeType) Type() Type {
    method Version (line 1831) | func (t NativeType) Version() byte {
    method Custom (line 1835) | func (t NativeType) Custom() string {
    method String (line 1839) | func (t NativeType) String() string {
  function NewNativeType (line 1776) | func NewNativeType(proto byte, typ Type) NativeType {
  function NewCustomType (line 1780) | func NewCustomType(proto byte, typ Type, custom string) NativeType {
  function NewCollectionType (line 1848) | func NewCollectionType(m NativeType, key, elem TypeInfo) CollectionType {
  type CollectionType (line 1856) | type CollectionType struct
    method NewWithError (line 1879) | func (t CollectionType) NewWithError() (any, error) {
    method String (line 1956) | func (t CollectionType) String() string {
  type VectorType (line 1864) | type VectorType struct
    method Zero (line 1871) | func (v VectorType) Zero() any {
  function NewTupleType (line 1969) | func NewTupleType(n NativeType, elems ...TypeInfo) TupleTypeInfo {
  type TupleTypeInfo (line 1976) | type TupleTypeInfo struct
    method String (line 1981) | func (t TupleTypeInfo) String() string {
    method NewWithError (line 1992) | func (t TupleTypeInfo) NewWithError() (any, error) {
  type UDTField (line 1997) | type UDTField struct
  function NewUDTType (line 2002) | func NewUDTType(proto byte, name, keySpace string, elems ...UDTField) UD...
  type UDTTypeInfo (line 2011) | type UDTTypeInfo struct
    method NewWithError (line 2018) | func (t UDTTypeInfo) NewWithError() (any, error) {
    method String (line 2026) | func (t UDTTypeInfo) String() string {
  type Type (line 2048) | type Type
    method String (line 2081) | func (t Type) String() string {
  constant TypeCustom (line 2051) | TypeCustom    Type = 0x0000
  constant TypeAscii (line 2052) | TypeAscii     Type = 0x0001
  constant TypeBigInt (line 2053) | TypeBigInt    Type = 0x0002
  constant TypeBlob (line 2054) | TypeBlob      Type = 0x0003
  constant TypeBoolean (line 2055) | TypeBoolean   Type = 0x0004
  constant TypeCounter (line 2056) | TypeCounter   Type = 0x0005
  constant TypeDecimal (line 2057) | TypeDecimal   Type = 0x0006
  constant TypeDouble (line 2058) | TypeDouble    Type = 0x0007
  constant TypeFloat (line 2059) | TypeFloat     Type = 0x0008
  constant TypeInt (line 2060) | TypeInt       Type = 0x0009
  constant TypeText (line 2061) | TypeText      Type = 0x000A
  constant TypeTimestamp (line 2062) | TypeTimestamp Type = 0x000B
  constant TypeUUID (line 2063) | TypeUUID      Type = 0x000C
  constant TypeVarchar (line 2064) | TypeVarchar   Type = 0x000D
  constant TypeVarint (line 2065) | TypeVarint    Type = 0x000E
  constant TypeTimeUUID (line 2066) | TypeTimeUUID  Type = 0x000F
  constant TypeInet (line 2067) | TypeInet      Type = 0x0010
  constant TypeDate (line 2068) | TypeDate      Type = 0x0011
  constant TypeTime (line 2069) | TypeTime      Type = 0x0012
  constant TypeSmallInt (line 2070) | TypeSmallInt  Type = 0x0013
  constant TypeTinyInt (line 2071) | TypeTinyInt   Type = 0x0014
  constant TypeDuration (line 2072) | TypeDuration  Type = 0x0015
  constant TypeList (line 2073) | TypeList      Type = 0x0020
  constant TypeMap (line 2074) | TypeMap       Type = 0x0021
  constant TypeSet (line 2075) | TypeSet       Type = 0x0022
  constant TypeUDT (line 2076) | TypeUDT       Type = 0x0030
  constant TypeTuple (line 2077) | TypeTuple     Type = 0x0031
  type MarshalError (line 2140) | type MarshalError struct
    method Error (line 2145) | func (m MarshalError) Error() string {
    method Cause (line 2152) | func (m MarshalError) Cause() error { return m.cause }
    method Unwrap (line 2154) | func (m MarshalError) Unwrap() error {
  function marshalErrorf (line 2158) | func marshalErrorf(format string, args ...any) MarshalError {
  function wrapMarshalError (line 2162) | func wrapMarshalError(err error, msg string) MarshalError {
  function wrapMarshalErrorf (line 2166) | func wrapMarshalErrorf(err error, format string, a ...any) MarshalError {
  type UnmarshalError (line 2170) | type UnmarshalError struct
    method Error (line 2175) | func (m UnmarshalError) Error() string {
    method Cause (line 2182) | func (m UnmarshalError) Cause() error { return m.cause }
    method Unwrap (line 2184) | func (m UnmarshalError) Unwrap() error {
  function unmarshalErrorf (line 2188) | func unmarshalErrorf(format string, args ...any) UnmarshalError {
  function wrapUnmarshalError (line 2192) | func wrapUnmarshalError(err error, msg string) UnmarshalError {
  function wrapUnmarshalErrorf (line 2196) | func wrapUnmarshalErrorf(err error, format string, a ...any) UnmarshalEr...

FILE: marshal_test.go
  type AliasInt (line 44) | type AliasInt
  type AliasUint (line 45) | type AliasUint
  type AliasUint8 (line 46) | type AliasUint8
  type AliasUint16 (line 47) | type AliasUint16
  type AliasUint32 (line 48) | type AliasUint32
  type AliasUint64 (line 49) | type AliasUint64
  function decimalize (line 93) | func decimalize(s string) *inf.Dec {
  function bigintize (line 98) | func bigintize(s string) *big.Int {
  function TestMarshal_Encode (line 103) | func TestMarshal_Encode(t *testing.T) {
  function TestMarshal_Decode (line 124) | func TestMarshal_Decode(t *testing.T) {
  function equalStringPointerSlice (line 163) | func equalStringPointerSlice(leftList, rightList []*string) bool {
  function TestMarshalList (line 175) | func TestMarshalList(t *testing.T) {
  type CustomString (line 246) | type CustomString
    method MarshalCQL (line 248) | func (c CustomString) MarshalCQL(info TypeInfo) ([]byte, error) {
    method UnmarshalCQL (line 251) | func (c *CustomString) UnmarshalCQL(info TypeInfo, data []byte) error {
  type MyString (line 256) | type MyString
  function testType (line 286) | func testType(t *testing.T, cassType string, expectedType Type) {
  function TestLookupCassType (line 292) | func TestLookupCassType(t *testing.T) {
  type MyPointerMarshaler (line 300) | type MyPointerMarshaler struct
    method MarshalCQL (line 302) | func (m *MyPointerMarshaler) MarshalCQL(_ TypeInfo) ([]byte, error) {
  function TestMarshalTuple (line 306) | func TestMarshalTuple(t *testing.T) {
  function TestUnmarshalTuple (line 454) | func TestUnmarshalTuple(t *testing.T) {
  function TestMarshalUDTMap (line 531) | func TestMarshalUDTMap(t *testing.T) {
  function TestMarshalUDTStruct (line 593) | func TestMarshalUDTStruct(t *testing.T) {
  function TestMarshalNil (line 669) | func TestMarshalNil(t *testing.T) {
  function TestUnmarshalInetCopyBytes (line 700) | func TestUnmarshalInetCopyBytes(t *testing.T) {
  function BenchmarkUnmarshalVarchar (line 716) | func BenchmarkUnmarshalVarchar(b *testing.B) {
  function TestReadCollectionSize (line 729) | func TestReadCollectionSize(t *testing.T) {
  function TestReadUnsignedVInt (line 794) | func TestReadUnsignedVInt(t *testing.T) {
  function BenchmarkUnmarshalUUID (line 825) | func BenchmarkUnmarshalUUID(b *testing.B) {
  function TestUnmarshalUDT (line 838) | func TestUnmarshalUDT(t *testing.T) {
  function TestUnmarshalListIntoInterface (line 871) | func TestUnmarshalListIntoInterface(t *testing.T) {
  function TestUnmarshalMapIntoInterface (line 913) | func TestUnmarshalMapIntoInterface(t *testing.T) {
  function TestUnmarshalListWithVectorIntoInterface (line 959) | func TestUnmarshalListWithVectorIntoInterface(t *testing.T) {
  function bytesWithLength (line 1021) | func bytesWithLength(data ...[]byte) []byte {
  function TestUnmarshalVectorZeroDimensions (line 1039) | func TestUnmarshalVectorZeroDimensions(t *testing.T) {
  function TestNativeNewWithErrorConsistentWithGoType (line 1106) | func TestNativeNewWithErrorConsistentWithGoType(t *testing.T) {
  function TestCollectionNewWithErrorConsistentWithGoType (line 1163) | func TestCollectionNewWithErrorConsistentWithGoType(t *testing.T) {

FILE: metadata_scylla.go
  type KeyspaceMetadata (line 24) | type KeyspaceMetadata struct
    method Clone (line 42) | func (ks *KeyspaceMetadata) Clone() *KeyspaceMetadata {
    method removeTableData (line 62) | func (ks *KeyspaceMetadata) removeTableData(tableName string) {
    method invalidateTable (line 78) | func (ks *KeyspaceMetadata) invalidateTable(tableName string) {
    method removeTable (line 86) | func (ks *KeyspaceMetadata) removeTable(tableName string) {
  type TableMetadata (line 94) | type TableMetadata struct
    method Equals (line 251) | func (t *TableMetadata) Equals(other *TableMetadata) bool {
  type TableMetadataOptions (line 106) | type TableMetadataOptions struct
    method Equals (line 127) | func (t *TableMetadataOptions) Equals(other *TableMetadataOptions) bool {
  type ViewMetadata (line 159) | type ViewMetadata struct
  type ColumnMetadata (line 177) | type ColumnMetadata struct
    method Equals (line 189) | func (c *ColumnMetadata) Equals(other *ColumnMetadata) bool {
  type FunctionMetadata (line 206) | type FunctionMetadata struct
  type AggregateMetadata (line 218) | type AggregateMetadata struct
  type TypeMetadata (line 232) | type TypeMetadata struct
  type IndexMetadata (line 239) | type IndexMetadata struct
  function compareColumnSlices (line 291) | func compareColumnSlices(a, b []*ColumnMetadata) bool {
  function compareColumnsMap (line 300) | func compareColumnsMap(a, b map[string]*ColumnMetadata) bool {
  function compareStringSlices (line 310) | func compareStringSlices(a, b []string) bool {
  function compareStringMaps (line 319) | func compareStringMaps(a, b map[string]string) bool {
  function compareInterfaceMaps (line 331) | func compareInterfaceMaps(a, b map[string]any) bool {
  type cowKeyspaceMetadataMap (line 345) | type cowKeyspaceMetadataMap struct
    method get (line 350) | func (c *cowKeyspaceMetadataMap) get() map[string]*KeyspaceMetadata {
    method getKeyspace (line 358) | func (c *cowKeyspaceMetadataMap) getKeyspace(keyspaceName string) (*Ke...
    method set (line 367) | func (c *cowKeyspaceMetadataMap) set(keyspaceName string, keyspaceMeta...
    method invalidateTable (line 383) | func (c *cowKeyspaceMetadataMap) invalidateTable(keyspaceName, tableNa...
    method removeKeyspace (line 389) | func (c *cowKeyspaceMetadataMap) removeKeyspace(keyspaceName string) {
    method updateKeyspace (line 404) | func (c *cowKeyspaceMetadataMap) updateKeyspace(keyspaceName string, f...
  constant IndexKindCustom (line 424) | IndexKindCustom = "CUSTOM"
  type ColumnOrder (line 428) | type ColumnOrder
  constant ASC (line 431) | ASC  ColumnOrder = false
  constant DESC (line 432) | DESC             = true
  type ColumnIndexMetadata (line 435) | type ColumnIndexMetadata struct
    method Equals (line 441) | func (c *ColumnIndexMetadata) Equals(other *ColumnIndexMetadata) bool {
  type ColumnKind (line 464) | type ColumnKind
    method String (line 475) | func (c ColumnKind) String() string {
    method UnmarshalCQL (line 492) | func (c *ColumnKind) UnmarshalCQL(typ TypeInfo, p []byte) error {
  constant ColumnUnkownKind (line 467) | ColumnUnkownKind ColumnKind = iota
  constant ColumnPartitionKey (line 468) | ColumnPartitionKey
  constant ColumnClusteringKey (line 469) | ColumnClusteringKey
  constant ColumnRegular (line 470) | ColumnRegular
  constant ColumnCompact (line 471) | ColumnCompact
  constant ColumnStatic (line 472) | ColumnStatic
  function columnKindFromSchema (line 506) | func columnKindFromSchema(kind string) (ColumnKind, error) {
  type Metadata (line 523) | type Metadata struct
  type metadataDescriber (line 529) | type metadataDescriber struct
    method getKeyspaceInternal (line 555) | func (s *metadataDescriber) getKeyspaceInternal(keyspaceName string) (...
    method GetKeyspace (line 574) | func (s *metadataDescriber) GetKeyspace(keyspaceName string) (*Keyspac...
    method getTableFromSnapshot (line 587) | func (s *metadataDescriber) getTableFromSnapshot(
    method GetTable (line 614) | func (s *metadataDescriber) GetTable(keyspaceName, tableName string) (...
    method getTablets (line 646) | func (s *metadataDescriber) getTablets() tablets.TabletInfoList {
    method getTableTablets (line 650) | func (s *metadataDescriber) getTableTablets(keyspace, table string) ta...
    method forEachTablet (line 654) | func (s *metadataDescriber) forEachTablet(fn func(keyspace, table stri...
    method AddTablet (line 658) | func (s *metadataDescriber) AddTablet(tablet tablets.TabletInfo) {
    method RemoveTabletsWithHost (line 664) | func (s *metadataDescriber) RemoveTabletsWithHost(host *HostInfo) {
    method RemoveTabletsWithKeyspace (line 670) | func (s *metadataDescriber) RemoveTabletsWithKeyspace(keyspace string) {
    method RemoveTabletsWithTable (line 676) | func (s *metadataDescriber) RemoveTabletsWithTable(keyspace string, ta...
    method invalidateKeyspaceSchema (line 681) | func (s *metadataDescriber) invalidateKeyspaceSchema(keyspaceName stri...
    method invalidateTableSchema (line 685) | func (s *metadataDescriber) invalidateTableSchema(keyspaceName, tableN...
    method deduplicatedRefreshKeyspace (line 691) | func (s *metadataDescriber) deduplicatedRefreshKeyspace(keyspaceName s...
    method deduplicatedRefreshTable (line 700) | func (s *metadataDescriber) deduplicatedRefreshTable(keyspaceName, tab...
    method refreshAllSchema (line 708) | func (s *metadataDescriber) refreshAllSchema() error {
    method refreshKeyspaceSchema (line 762) | func (s *metadataDescriber) refreshKeyspaceSchema(keyspaceName string)...
    method refreshTableSchema (line 836) | func (s *metadataDescriber) refreshTableSchema(keyspaceName, tableName...
  function newMetadataDescriber (line 546) | func newMetadataDescriber(session *Session) *metadataDescriber {
  function tableNotFoundError (line 579) | func tableNotFoundError(keyspaceName, tableName string) error {
  function compileMetadata (line 888) | func compileMetadata(
  function compileTableMetadata (line 990) | func compileTableMetadata(
  function compileColumns (line 1085) | func compileColumns(columns map[string]*ColumnMetadata, orderedColumns [...
  function componentColumnCountOfType (line 1120) | func componentColumnCountOfType(columns map[string]*ColumnMetadata, kind...
  function getKeyspaceMetadata (line 1131) | func getKeyspaceMetadata(session *Session, keyspaceName string) (*Keyspa...
  function getTableMetadata (line 1165) | func getTableMetadata(session *Session, keyspaceName string) ([]TableMet...
  function getTableMetadataByName (line 1241) | func getTableMetadataByName(session *Session, keyspaceName, tableName st...
  constant columnMetadataColumns (line 1310) | columnMetadataColumns = `table_name, column_name, clustering_order, type...
  function getColumnMetadataByTable (line 1312) | func getColumnMetadataByTable(session *Session, keyspaceName, tableName ...
  function getIndexMetadataByTable (line 1339) | func getIndexMetadataByTable(session *Session, keyspaceName, tableName s...
  function getViewMetadataByTable (line 1368) | func getViewMetadataByTable(session *Session, keyspaceName, tableName st...
  function getColumnMetadata (line 1416) | func getColumnMetadata(session *Session, keyspaceName string) ([]ColumnM...
  function getTypeMetadata (line 1444) | func getTypeMetadata(session *Session, keyspaceName string) ([]TypeMetad...
  function getFunctionsMetadata (line 1472) | func getFunctionsMetadata(session *Session, keyspaceName string) ([]Func...
  function getAggregatesMetadata (line 1503) | func getAggregatesMetadata(session *Session, keyspaceName string) ([]Agg...
  function getIndexMetadata (line 1535) | func getIndexMetadata(session *Session, keyspaceName string) ([]IndexMet...
  function getCreateStatements (line 1565) | func getCreateStatements(session *Session, keyspaceName string) ([]byte,...
  function getViewMetadata (line 1594) | func getViewMetadata(session *Session, keyspaceName string) ([]ViewMetad...

FILE: metadata_scylla_test.go
  function TestGetKeyspaceMetadataMissingKeyspaceClosesIter (line 14) | func TestGetKeyspaceMetadataMissingKeyspaceClosesIter(t *testing.T) {
  function TestCompileMetadata (line 37) | func TestCompileMetadata(t *testing.T) {
  function assertPartitionKey (line 320) | func assertPartitionKey(t *testing.T, keyspaceName, tableName string, ac...
  function assertClusteringColumns (line 346) | func assertClusteringColumns(t *testing.T, keyspaceName, tableName strin...
  function assertColumns (line 379) | func assertColumns(t *testing.T, keyspaceName, tableName string, actual,...
  function assertOrderedColumns (line 421) | func assertOrderedColumns(t *testing.T, keyspaceName, tableName string, ...
  function assertTableMetadata (line 434) | func assertTableMetadata(t *testing.T, keyspaceName string, actual, expe...
  function assertViewsMetadata (line 456) | func assertViewsMetadata(t *testing.T, keyspaceName string, actual, expe...
  function assertIndicesMetadata (line 478) | func assertIndicesMetadata(t *testing.T, keyspaceName string, actual, ex...
  function assertKeyspaceMetadata (line 502) | func assertKeyspaceMetadata(t *testing.T, actual, expected *KeyspaceMeta...

FILE: policies.go
  type cowHostList (line 42) | type cowHostList struct
    method String (line 47) | func (c *cowHostList) String() string {
    method get (line 51) | func (c *cowHostList) get() []*HostInfo {
    method add (line 61) | func (c *cowHostList) add(host *HostInfo) bool {
    method remove (line 85) | func (c *cowHostList) remove(host *HostInfo) bool {
  type RetryableQuery (line 118) | type RetryableQuery interface
  type RetryType (line 125) | type RetryType
  constant Retry (line 128) | Retry         RetryType = 0x00
  constant RetryNextHost (line 129) | RetryNextHost RetryType = 0x01
  constant Ignore (line 130) | Ignore        RetryType = 0x02
  constant Rethrow (line 131) | Rethrow       RetryType = 0x03
  type RetryPolicy (line 145) | type RetryPolicy interface
  type LWTRetryPolicy (line 153) | type LWTRetryPolicy interface
  type SimpleRetryPolicy (line 167) | type SimpleRetryPolicy struct
    method Attempt (line 173) | func (s *SimpleRetryPolicy) Attempt(q RetryableQuery) bool {
    method AttemptLWT (line 177) | func (s *SimpleRetryPolicy) AttemptLWT(q RetryableQuery) bool {
    method GetRetryType (line 181) | func (s *SimpleRetryPolicy) GetRetryType(err error) RetryType {
    method GetRetryTypeLWT (line 193) | func (s *SimpleRetryPolicy) GetRetryTypeLWT(err error) RetryType {
  type ExponentialBackoffRetryPolicy (line 202) | type ExponentialBackoffRetryPolicy struct
    method Attempt (line 207) | func (e *ExponentialBackoffRetryPolicy) Attempt(q RetryableQuery) bool {
    method AttemptLWT (line 215) | func (e *ExponentialBackoffRetryPolicy) AttemptLWT(q RetryableQuery) b...
    method GetRetryType (line 237) | func (e *ExponentialBackoffRetryPolicy) GetRetryType(err error) RetryT...
    method GetRetryTypeLWT (line 249) | func (e *ExponentialBackoffRetryPolicy) GetRetryTypeLWT(err error) Ret...
    method napTime (line 320) | func (e *ExponentialBackoffRetryPolicy) napTime(attempts int) time.Dur...
  function getExponentialTime (line 220) | func getExponentialTime(min time.Duration, max time.Duration, attempts i...
  type DowngradingConsistencyRetryPolicy (line 272) | type DowngradingConsistencyRetryPolicy struct
    method Attempt (line 276) | func (d *DowngradingConsistencyRetryPolicy) Attempt(q RetryableQuery) ...
    method GetRetryType (line 287) | func (d *DowngradingConsistencyRetryPolicy) GetRetryType(err error) Re...
  type HostStateNotifier (line 324) | type HostStateNotifier interface
  type KeyspaceUpdateEvent (line 331) | type KeyspaceUpdateEvent struct
  type HostTierer (line 336) | type HostTierer interface
  type HostSelectionPolicy (line 353) | type HostSelectionPolicy interface
  type SelectedHost (line 373) | type SelectedHost interface
  type selectedHost (line 379) | type selectedHost struct
    method Info (line 384) | func (host selectedHost) Info() *HostInfo {
    method Token (line 388) | func (host selectedHost) Token() Token {
    method Mark (line 392) | func (host selectedHost) Mark(err error) {}
  function newSingleHost (line 394) | func newSingleHost(info *HostInfo, maxRetries byte, retryDelay time.Dura...
  type singleHost (line 398) | type singleHost struct
    method selectHost (line 405) | func (s *singleHost) selectHost() SelectedHost {
    method Info (line 416) | func (s singleHost) Info() *HostInfo { return s.info }
    method Token (line 418) | func (s singleHost) Token() Token { return nil }
    method Mark (line 420) | func (s singleHost) Mark(error) {}
  type NextHost (line 423) | type NextHost
  function RoundRobinHostPolicy (line 427) | func RoundRobinHostPolicy() HostSelectionPolicy {
  type roundRobinHostPolicy (line 431) | type roundRobinHostPolicy struct
    method IsLocal (line 436) | func (r *roundRobinHostPolicy) IsLocal(*HostInfo) bool              { ...
    method KeyspaceChanged (line 437) | func (r *roundRobinHostPolicy) KeyspaceChanged(KeyspaceUpdateEvent) {}
    method SetPartitioner (line 438) | func (r *roundRobinHostPolicy) SetPartitioner(partitioner string)   {}
    method Init (line 439) | func (r *roundRobinHostPolicy) Init(*Session)                       {}
    method Reset (line 440) | func (r *roundRobinHostPolicy) Reset()                              {}
    method IsOperational (line 441) | func (r *roundRobinHostPolicy) IsOperational(*Session) error        { ...
    method Pick (line 443) | func (r *roundRobinHostPolicy) Pick(qry ExecutableQuery) NextHost {
    method AddHost (line 448) | func (r *roundRobinHostPolicy) AddHost(host *HostInfo) {
    method RemoveHost (line 452) | func (r *roundRobinHostPolicy) RemoveHost(host *HostInfo) {
    method HostUp (line 456) | func (r *roundRobinHostPolicy) HostUp(host *HostInfo) {
    method HostDown (line 460) | func (r *roundRobinHostPolicy) HostDown(host *HostInfo) {
  function ShuffleReplicas (line 464) | func ShuffleReplicas() func(*tokenAwareHostPolicy) {
  function DontShuffleReplicas (line 470) | func DontShuffleReplicas() func(*tokenAwareHostPolicy) {
  function AvoidSlowReplicas (line 480) | func AvoidSlowReplicas(max_in_flight_threshold int) func(policy *tokenAw...
  function NonLocalReplicasFallback (line 493) | func NonLocalReplicasFallback() func(policy *tokenAwareHostPolicy) {
  function TokenAwareHostPolicy (line 502) | func TokenAwareHostPolicy(fallback HostSelectionPolicy, opts ...func(*to...
  type clusterMeta (line 517) | type clusterMeta struct
    method resetTokenRing (line 705) | func (m *clusterMeta) resetTokenRing(partitioner string, hosts []*Host...
  type tokenAwareHostPolicy (line 525) | type tokenAwareHostPolicy struct
    method Init (line 542) | func (t *tokenAwareHostPolicy) Init(s *Session) {
    method Reset (line 560) | func (t *tokenAwareHostPolicy) Reset() {
    method IsOperational (line 573) | func (t *tokenAwareHostPolicy) IsOperational(session *Session) error {
    method IsLocal (line 577) | func (t *tokenAwareHostPolicy) IsLocal(host *HostInfo) bool {
    method KeyspaceChanged (line 581) | func (t *tokenAwareHostPolicy) KeyspaceChanged(update KeyspaceUpdateEv...
    method updateReplicas (line 592) | func (t *tokenAwareHostPolicy) updateReplicas(meta *clusterMeta, keysp...
    method SetPartitioner (line 615) | func (t *tokenAwareHostPolicy) SetPartitioner(partitioner string) {
    method AddHost (line 629) | func (t *tokenAwareHostPolicy) AddHost(host *HostInfo) {
    method AddHosts (line 642) | func (t *tokenAwareHostPolicy) AddHosts(hosts []*HostInfo) {
    method RemoveHost (line 661) | func (t *tokenAwareHostPolicy) RemoveHost(host *HostInfo) {
    method HostUp (line 674) | func (t *tokenAwareHostPolicy) HostUp(host *HostInfo) {
    method HostDown (line 678) | func (t *tokenAwareHostPolicy) HostDown(host *HostInfo) {
    method getMetadataReadOnly (line 685) | func (t *tokenAwareHostPolicy) getMetadataReadOnly() *clusterMeta {
    method getMetadataForUpdate (line 694) | func (t *tokenAwareHostPolicy) getMetadataForUpdate() *clusterMeta {
    method Pick (line 816) | func (t *tokenAwareHostPolicy) Pick(qry ExecutableQuery) NextHost {
  type hostSet (line 725) | type hostSet struct
    method add (line 731) | func (s *hostSet) add(h *HostInfo) {
    method contains (line 746) | func (s *hostSet) contains(h *HostInfo) bool {
  function shuffleHostsInPlace (line 760) | func shuffleHostsInPlace(hosts []*HostInfo) {
  function partitionHealthy (line 768) | func partitionHealthy(replicas []*HostInfo, s *Session) {
  type dcAwareRR (line 966) | type dcAwareRR struct
    method setDCFailoverDisabled (line 995) | func (d *dcAwareRR) setDCFailoverDisabled() {
    method Init (line 998) | func (d *dcAwareRR) Init(*Session)                       {}
    method Reset (line 999) | func (d *dcAwareRR) Reset()                              {}
    method KeyspaceChanged (line 1000) | func (d *dcAwareRR) KeyspaceChanged(KeyspaceUpdateEvent) {}
    method SetPartitioner (line 1001) | func (d *dcAwareRR) SetPartitioner(p string)             {}
    method IsOperational (line 1003) | func (d *dcAwareRR) IsOperational(session *Session) error {
    method IsLocal (line 1021) | func (d *dcAwareRR) IsLocal(host *HostInfo) bool {
    method AddHost (line 1025) | func (d *dcAwareRR) AddHost(host *HostInfo) {
    method RemoveHost (line 1033) | func (d *dcAwareRR) RemoveHost(host *HostInfo) {
    method HostUp (line 1041) | func (d *dcAwareRR) HostUp(host *HostInfo)   { d.AddHost(host) }
    method HostDown (line 1042) | func (d *dcAwareRR) HostDown(host *HostInfo) { d.RemoveHost(host) }
    method Pick (line 1085) | func (d *dcAwareRR) Pick(q ExecutableQuery) NextHost {
  type dcFailoverDisabledPolicy (line 974) | type dcFailoverDisabledPolicy interface
  type dcAwarePolicyOption (line 978) | type dcAwarePolicyOption
  function HostPolicyOptionDisableDCFailover (line 980) | func HostPolicyOptionDisableDCFailover(p dcFailoverDisabledPolicy) {
  function DCAwareRoundRobinPolicy (line 987) | func DCAwareRoundRobinPolicy(localDC string, opts ...dcAwarePolicyOption...
  function roundRobbin (line 1052) | func roundRobbin(shift int, hosts ...[]*HostInfo) NextHost {
  type rackAwareRR (line 1097) | type rackAwareRR struct
    method Init (line 1117) | func (d *rackAwareRR) Init(*Session)                       {}
    method Reset (line 1118) | func (d *rackAwareRR) Reset()                              {}
    method KeyspaceChanged (line 1119) | func (d *rackAwareRR) KeyspaceChanged(KeyspaceUpdateEvent) {}
    method SetPartitioner (line 1120) | func (d *rackAwareRR) SetPartitioner(p string)             {}
    method IsOperational (line 1122) | func (d *rackAwareRR) IsOperational(session *Session) error {
    method MaxHostTier (line 1138) | func (d *rackAwareRR) MaxHostTier() uint {
    method setDCFailoverDisabled (line 1142) | func (d *rackAwareRR) setDCFailoverDisabled() {
    method HostTier (line 1146) | func (d *rackAwareRR) HostTier(host *HostInfo) uint {
    method IsLocal (line 1158) | func (d *rackAwareRR) IsLocal(host *HostInfo) bool {
    method AddHost (line 1162) | func (d *rackAwareRR) AddHost(host *HostInfo) {
    method RemoveHost (line 1167) | func (d *rackAwareRR) RemoveHost(host *HostInfo) {
    method HostUp (line 1172) | func (d *rackAwareRR) HostUp(host *HostInfo)   { d.AddHost(host) }
    method HostDown (line 1173) | func (d *rackAwareRR) HostDown(host *HostInfo) { d.RemoveHost(host) }
    method Pick (line 1175) | func (d *rackAwareRR) Pick(q ExecutableQuery) NextHost {
  function RackAwareRoundRobinPolicy (line 1109) | func RackAwareRoundRobinPolicy(localDC string, localRack string, opts .....
  type ReadyPolicy (line 1187) | type ReadyPolicy interface
  function SingleHostReadyPolicy (line 1193) | func SingleHostReadyPolicy(p HostSelectionPolicy) *singleHostReadyPolicy {
  type singleHostReadyPolicy (line 1199) | type singleHostReadyPolicy struct
    method HostUp (line 1205) | func (s *singleHostReadyPolicy) HostUp(host *HostInfo) {
    method Ready (line 1213) | func (s *singleHostReadyPolicy) Ready() bool {
  type ConvictionPolicy (line 1230) | type ConvictionPolicy interface
  type SimpleConvictionPolicy (line 1239) | type SimpleConvictionPolicy struct
    method AddFailure (line 1241) | func (e *SimpleConvictionPolicy) AddFailure(error error, host *HostInf...
    method Reset (line 1245) | func (e *SimpleConvictionPolicy) Reset(host *HostInfo) {}
  type ReconnectionPolicy (line 1250) | type ReconnectionPolicy interface
  type NoReconnectionPolicy (line 1260) | type NoReconnectionPolicy struct
    method GetInterval (line 1263) | func (c *NoReconnectionPolicy) GetInterval(currentRetry int) time.Dura...
    method GetMaxRetries (line 1267) | func (c *NoReconnectionPolicy) GetMaxRetries() int {
  type ConstantReconnectionPolicy (line 1276) | type ConstantReconnectionPolicy struct
    method GetInterval (line 1281) | func (c *ConstantReconnectionPolicy) GetInterval(currentRetry int) tim...
    method GetMaxRetries (line 1285) | func (c *ConstantReconnectionPolicy) GetMaxRetries() int {
  type ExponentialReconnectionPolicy (line 1290) | type ExponentialReconnectionPolicy struct
    method GetInterval (line 1296) | func (e *ExponentialReconnectionPolicy) GetInterval(currentRetry int) ...
    method GetMaxRetries (line 1304) | func (e *ExponentialReconnectionPolicy) GetMaxRetries() int {
  type SpeculativeExecutionPolicy (line 1308) | type SpeculativeExecutionPolicy interface
  type NonSpeculativeExecution (line 1313) | type NonSpeculativeExecution struct
    method Attempts (line 1319) | func (sp NonSpeculativeExecution) Attempts() int        { return 0 }
    method Delay (line 1320) | func (sp NonSpeculativeExecution) Delay() time.Duration { return 1 }
  type SimpleSpeculativeExecution (line 1322) | type SimpleSpeculativeExecution struct
    method Attempts (line 1327) | func (sp *SimpleSpeculativeExecution) Attempts() int        { return s...
    method Delay (line 1328) | func (sp *SimpleSpeculativeExecution) Delay() time.Duration { return s...

FILE: policies_bench_test.go
  function setupTabletAwareBench (line 20) | func setupTabletAwareBench(b *testing.B, numHosts, numTablets, rf int) (...
  function BenchmarkTabletAwarePick (line 119) | func BenchmarkTabletAwarePick(b *testing.B) {
  function BenchmarkTabletAwarePickAllReplicas (line 146) | func BenchmarkTabletAwarePickAllReplicas(b *testing.B) {
  function BenchmarkHostIdComparison (line 171) | func BenchmarkHostIdComparison(b *testing.B) {

FILE: policies_integration_test.go
  function TestDCValidationTokenAware (line 13) | func TestDCValidationTokenAware(t *testing.T) {
  function TestDCValidationDCAware (line 27) | func TestDCValidationDCAware(t *testing.T) {
  function TestDCValidationRackAware (line 39) | func TestDCValidationRackAware(t *testing.T) {
  function TestTokenAwareHostPolicy (line 51) | func TestTokenAwareHostPolicy(t *testing.T) {
  function testIfPolicyInitializedProperly (line 75) | func testIfPolicyInitializedProperly(t *testing.T, cluster *ClusterConfi...
  function TestNoHangAllHostsDown (line 105) | func TestNoHangAllHostsDown(t *testing.T) {

FILE: policies_test.go
  function tUUID (line 52) | func tUUID(n int) UUID {
  function tID (line 62) | func tID(n int) string {
  function TestRoundRobbin (line 67) | func TestRoundRobbin(t *testing.T) {
  function TestRoundRobbinSameConnectAddress (line 95) | func TestRoundRobbinSameConnectAddress(t *testing.T) {
  function TestHostPolicy_TokenAware_SimpleStrategy (line 125) | func TestHostPolicy_TokenAware_SimpleStrategy(t *testing.T) {
  function TestHostPolicy_TokenAware_LWT_DisablesHostShuffling (line 197) | func TestHostPolicy_TokenAware_LWT_DisablesHostShuffling(t *testing.T) {
  function createPolicy (line 280) | func createPolicy(keyspace string, shuffle bool) HostSelectionPolicy {
  function TestHostPolicy_RoundRobin_NilHostInfo (line 307) | func TestHostPolicy_RoundRobin_NilHostInfo(t *testing.T) {
  function TestHostPolicy_TokenAware_NilHostInfo (line 334) | func TestHostPolicy_TokenAware_NilHostInfo(t *testing.T) {
  function TestCOWList_Add (line 383) | func TestCOWList_Add(t *testing.T) {
  function TestSimpleRetryPolicy (line 414) | func TestSimpleRetryPolicy(t *testing.T) {
  function TestLWTSimpleRetryPolicy (line 474) | func TestLWTSimpleRetryPolicy(t *testing.T) {
  function TestExponentialBackoffPolicy (line 484) | func TestExponentialBackoffPolicy(t *testing.T) {
  function TestLWTExponentialBackoffPolicy (line 542) | func TestLWTExponentialBackoffPolicy(t *testing.T) {
  function TestDowngradingConsistencyRetryPolicy (line 552) | func TestDowngradingConsistencyRetryPolicy(t *testing.T) {
  function expectHosts (line 613) | func expectHosts(t *testing.T, msg string, iter NextHost, hostIDs ...str...
  function expectNoMoreHosts (line 643) | func expectNoMoreHosts(t *testing.T, iter NextHost) {
  function TestHostPolicy_DCAwareRR (line 658) | func TestHostPolicy_DCAwareRR(t *testing.T) {
  function TestHostPolicy_DCAwareRR_disableDCFailover (line 706) | func TestHostPolicy_DCAwareRR_disableDCFailover(t *testing.T) {
  function TestHostPolicy_TokenAware (line 751) | func TestHostPolicy_TokenAware(t *testing.T) {
  function TestHostPolicy_TokenAware_NetworkStrategy (line 855) | func TestHostPolicy_TokenAware_NetworkStrategy(t *testing.T) {
  function TestHostPolicy_RackAwareRR (line 947) | func TestHostPolicy_RackAwareRR(t *testing.T) {
  function TestHostPolicy_TokenAware_RackAware (line 980) | func TestHostPolicy_TokenAware_RackAware(t *testing.T) {
  function TestHostPolicy_TokenAware_Issue1274 (line 1114) | func TestHostPolicy_TokenAware_Issue1274(t *testing.T) {
  function TestTokenAwarePolicyReset (line 1193) | func TestTokenAwarePolicyReset(t *testing.T) {
  function TestTokenAwareHostPolicyTabletPath (line 1240) | func TestTokenAwareHostPolicyTabletPath(t *testing.T) {
  type fixedInt64Partitioner (line 1349) | type fixedInt64Partitioner
    method Name (line 1351) | func (f fixedInt64Partitioner) Name() string               { return "F...
    method Hash (line 1352) | func (f fixedInt64Partitioner) Hash([]byte) Token          { return in...
    method ParseString (line 1353) | func (f fixedInt64Partitioner) ParseString(s string) Token { return pa...
  function TestHostSetInline (line 1355) | func TestHostSetInline(t *testing.T) {
  function TestHostSetOverflow (line 1377) | func TestHostSetOverflow(t *testing.T) {
  function TestHostSetOverflowPreservesInlineEntries (line 1400) | func TestHostSetOverflowPreservesInlineEntries(t *testing.T) {

FILE: prepared_cache.go
  constant defaultMaxPreparedStmts (line 34) | defaultMaxPreparedStmts = 1000
  type stmtCacheKey (line 41) | type stmtCacheKey struct
  type preparedLRU (line 48) | type preparedLRU struct
    method clear (line 53) | func (p *preparedLRU) clear() {
    method add (line 62) | func (p *preparedLRU) add(key stmtCacheKey, val *inflightPrepare) {
    method remove (line 68) | func (p *preparedLRU) remove(key stmtCacheKey) bool {
    method execIfMissing (line 74) | func (p *preparedLRU) execIfMissing(key stmtCacheKey, fn func(cache *l...
    method keyFor (line 89) | func (p *preparedLRU) keyFor(hostID, keyspace, statement string) stmtC...
    method evictPreparedID (line 97) | func (p *preparedLRU) evictPreparedID(key stmtCacheKey, id []byte) {

FILE: query_error_test.go
  function TestQueryError_PotentiallyExecuted (line 12) | func TestQueryError_PotentiallyExecuted(t *testing.T) {
  function TestQueryError_IsIdempotent (line 47) | func TestQueryError_IsIdempotent(t *testing.T) {
  function TestQueryError_Error (line 82) | func TestQueryError_Error(t *testing.T) {

FILE: query_executor.go
  type ExecutableQuery (line 35) | type ExecutableQuery interface
  type queryExecutor (line 57) | type queryExecutor struct
    method attemptQuery (line 62) | func (q *queryExecutor) attemptQuery(ctx context.Context, qry Executab...
    method speculate (line 72) | func (q *queryExecutor) speculate(ctx context.Context, qry ExecutableQ...
    method executeQuery (line 92) | func (q *queryExecutor) executeQuery(qry ExecutableQuery) (*Iter, erro...
    method do (line 153) | func (q *queryExecutor) do(ctx context.Context, qry ExecutableQuery, h...
    method run (line 277) | func (q *queryExecutor) run(ctx context.Context, qry ExecutableQuery, ...

FILE: recreate.go
  method ToCQL (line 19) | func (ks *KeyspaceMetadata) ToCQL() (string, error) {
  method typesSortedTopologically (line 73) | func (ks *KeyspaceMetadata) typesSortedTopologically() []*TypeMetadata {
  method tableToCQL (line 101) | func (ks *KeyspaceMetadata) tableToCQL(w io.Writer, kn string, tm *Table...
  method functionToCQL (line 130) | func (ks *KeyspaceMetadata) functionToCQL(w io.Writer, keyspaceName stri...
  method viewToCQL (line 160) | func (ks *KeyspaceMetadata) viewToCQL(w io.Writer, vm *ViewMetadata) err...
  method aggregateToCQL (line 190) | func (ks *KeyspaceMetadata) aggregateToCQL(w io.Writer, am *AggregateMet...
  method userTypeToCQL (line 209) | func (ks *KeyspaceMetadata) userTypeToCQL(w io.Writer, tm *TypeMetadata)...
  method indexToCQL (line 216) | func (ks *KeyspaceMetadata) indexToCQL(w io.Writer, im *IndexMetadata) e...
  method keyspaceToCQL (line 264) | func (ks *KeyspaceMetadata) keyspaceToCQL(w io.Writer) error {
  function contains (line 271) | func contains(in []string, v string) bool {
  type toCQLHelpers (line 280) | type toCQLHelpers struct
    method zip (line 284) | func (h toCQLHelpers) zip(a []string, b []string) [][]string {
    method escape (line 292) | func (h toCQLHelpers) escape(e any) string {
    method stripFrozen (line 309) | func (h toCQLHelpers) stripFrozen(v string) string {
    method fixStrategy (line 312) | func (h toCQLHelpers) fixStrategy(v string) string {
    method fixQuote (line 316) | func (h toCQLHelpers) fixQuote(v string) string {
    method tableOptionsToCQL (line 320) | func (h toCQLHelpers) tableOptionsToCQL(ops TableMetadataOptions) ([]s...
    method tableExtensionsToCQL (line 371) | func (h toCQLHelpers) tableExtensionsToCQL(extensions map[string]any) ...
    method tablePropertiesToCQL (line 397) | func (h toCQLHelpers) tablePropertiesToCQL(cks []*ColumnMetadata, opts...
    method tableColumnToCQL (line 427) | func (h toCQLHelpers) tableColumnToCQL(tm *TableMetadata) string {
    method partitionKeyString (line 454) | func (h toCQLHelpers) partitionKeyString(pks, cks []*ColumnMetadata) s...
  type scyllaEncryptionOptions (line 483) | type scyllaEncryptionOptions struct
    method UnmarshalBinary (line 498) | func (enc *scyllaEncryptionOptions) UnmarshalBinary(data []byte) error {

FILE: recreate_test.go
  function TestRecreateSchema (line 26) | func TestRecreateSchema(t *testing.T) {
  function isDescribeKeyspaceSupported (line 240) | func isDescribeKeyspaceSupported(t *testing.T, s *Session) bool {
  function TestScyllaEncryptionOptionsUnmarshaller (line 255) | func TestScyllaEncryptionOptionsUnmarshaller(t *testing.T) {
  function cleanup (line 289) | func cleanup(t *testing.T, session *Session, keyspace string) {
  function sortQueries (line 297) | func sortQueries(in []string) []string {
  function trimQueries (line 303) | func trimQueries(in []string) []string {
  function trimSchema (line 319) | func trimSchema(s string) string {

FILE: ring_describer.go
  type ringDescriber (line 10) | type ringDescriber struct
    method setControlConn (line 24) | func (r *ringDescriber) setControlConn(c controlConnection) {
    method getLocalHostInfo (line 32) | func (r *ringDescriber) getLocalHostInfo(conn ConnInterface) (*HostInf...
    method getClusterPeerInfo (line 47) | func (r *ringDescriber) getClusterPeerInfo(localHost *HostInfo, c Conn...
    method GetHostsFromSystem (line 105) | func (r *ringDescriber) GetHostsFromSystem() ([]*HostInfo, string, err...
    method getHostByIP (line 141) | func (r *ringDescriber) getHostByIP(ip string) (*HostInfo, bool) {
    method getHost (line 148) | func (r *ringDescriber) getHost(hostID string) *HostInfo {
    method getHostsList (line 155) | func (r *ringDescriber) getHostsList() []*HostInfo {
    method getHostsMap (line 165) | func (r *ringDescriber) getHostsMap() map[string]*HostInfo {
    method addOrUpdate (line 175) | func (r *ringDescriber) addOrUpdate(host *HostInfo) *HostInfo {
    method addHostIfMissing (line 183) | func (r *ringDescriber) addHostIfMissing(host *HostInfo) (*HostInfo, b...
    method removeHost (line 207) | func (r *ringDescriber) removeHost(hostID string) bool {
  function getPeersFromQuerySystemPeers (line 69) | func getPeersFromQuerySystemPeers(querySystemPeerRows []map[string]any, ...
  function isValidPeer (line 93) | func isValidPeer(host *HostInfo) bool {
  function isZeroToken (line 100) | func isZeroToken(host *HostInfo) bool {

FILE: ring_describer_test.go
  function TestGetClusterPeerInfoZeroToken (line 18) | func TestGetClusterPeerInfoZeroToken(t *testing.T) {
  type mockConnection (line 88) | type mockConnection struct
    method Close (line 90) | func (*mockConnection) Close() {}
    method exec (line 91) | func (*mockConnection) exec(ctx context.Context, req frameBuilder, tra...
    method awaitSchemaAgreement (line 94) | func (*mockConnection) awaitSchemaAgreement(ctx context.Context) error...
    method executeQuery (line 95) | func (*mockConnection) executeQuery(ctx context.Context, qry *Query) *...
    method querySystem (line 262) | func (*mockConnection) querySystem(ctx context.Context, query string, ...
    method getIsSchemaV2 (line 285) | func (*mockConnection) getIsSchemaV2() bool { return false }
    method setSchemaV2 (line 286) | func (*mockConnection) setSchemaV2(s bool)  {}
    method getScyllaSupported (line 287) | func (*mockConnection) getScyllaSupported() ScyllaConnectionFeatures {
  type mockControlConn (line 291) | type mockControlConn struct
    method querySystem (line 293) | func (m *mockControlConn) querySystem(statement string, values ...any)...
    method reconnect (line 297) | func (m *mockControlConn) reconnect() error {
    method getConn (line 301) | func (m *mockControlConn) getConn() *connHost {
    method awaitSchemaAgreement (line 308) | func (m *mockControlConn) awaitSchemaAgreement() error                ...
    method query (line 309) | func (m *mockControlConn) query(statement string, values ...any) (iter...
    method discoverProtocol (line 310) | func (m *mockControlConn) discoverProtocol(hosts []*HostInfo) (int, er...
    method connect (line 311) | func (m *mockControlConn) connect(hosts []*HostInfo) error            ...
    method close (line 312) | func (m *mockControlConn) close()                                     ...
    method getSession (line 313) | func (m *mockControlConn) getSession() *Session                       ...
  function marshalMetadataMust (line 315) | func marshalMetadataMust(metadata resultMetadata, data []any) [][]byte {
  type trackingRingConnection (line 331) | type trackingRingConnection struct
    method Close (line 336) | func (*trackingRingConnection) Close() {}
    method exec (line 337) | func (*trackingRingConnection) exec(context.Context, frameBuilder, Tra...
    method awaitSchemaAgreement (line 340) | func (*trackingRingConnection) awaitSchemaAgreement(context.Context) e...
    method executeQuery (line 341) | func (*trackingRingConnection) executeQuery(context.Context, *Query) *...
    method querySystem (line 342) | func (c *trackingRingConnection) querySystem(context.Context, string, ...
    method getIsSchemaV2 (line 345) | func (c *trackingRingConnection) getIsSchemaV2() bool { return c.schem...
    method setSchemaV2 (line 346) | func (*trackingRingConnection) setSchemaV2(bool)      {}
    method getScyllaSupported (line 347) | func (*trackingRingConnection) getScyllaSupported() ScyllaConnectionFe...
  function TestMockGetHostsFromSystem (line 351) | func TestMockGetHostsFromSystem(t *testing.T) {
  function TestRingDescriberGetClusterPeerInfoClosesIter (line 366) | func TestRingDescriberGetClusterPeerInfoClosesIter(t *testing.T) {
  function TestRing_AddHostIfMissing_Missing (line 404) | func TestRing_AddHostIfMissing_Missing(t *testing.T) {
  function TestRing_AddHostIfMissing_Existing (line 420) | func TestRing_AddHostIfMissing_Existing(t *testing.T) {

FILE: schema_queries_test.go
  function TestSchemaQueries (line 12) | func TestSchemaQueries(t *testing.T) {

FILE: scylla.go
  type ScyllaConnectionFeatures (line 22) | type ScyllaConnectionFeatures struct
    method Shard (line 28) | func (f ScyllaConnectionFeatures) Shard() int {
  type ScyllaHostFeatures (line 32) | type ScyllaHostFeatures struct
    method IsPresent (line 56) | func (f ScyllaHostFeatures) IsPresent() bool {
    method Partitioner (line 60) | func (f ScyllaHostFeatures) Partitioner() string {
    method ShardingAlgorithm (line 64) | func (f ScyllaHostFeatures) ShardingAlgorithm() string {
    method ShardsCount (line 68) | func (f ScyllaHostFeatures) ShardsCount() int {
    method MSBIgnore (line 72) | func (f ScyllaHostFeatures) MSBIgnore() uint64 {
    method LWTFlagMask (line 76) | func (f ScyllaHostFeatures) LWTFlagMask() int {
    method ShardAwarePort (line 80) | func (f ScyllaHostFeatures) ShardAwarePort() uint16 {
    method ShardAwarePortTLS (line 84) | func (f ScyllaHostFeatures) ShardAwarePortTLS() uint16 {
    method RateLimitErrorCode (line 88) | func (f ScyllaHostFeatures) RateLimitErrorCode() int {
    method IsMetadataIDSupported (line 92) | func (f ScyllaHostFeatures) IsMetadataIDSupported() bool {
  type cqlProtocolExtension (line 99) | type cqlProtocolExtension interface
  function findCQLProtoExtByName (line 104) | func findCQLProtoExtByName(exts []cqlProtocolExtension, name string) cql...
  constant lwtAddMetadataMarkKey (line 117) | lwtAddMetadataMarkKey = "SCYLLA_LWT_ADD_METADATA_MARK"
  constant rateLimitError (line 118) | rateLimitError        = "SCYLLA_RATE_LIMIT_ERROR"
  constant tabletsRoutingV1 (line 119) | tabletsRoutingV1      = "TABLETS_ROUTING_V1"
  type tabletsRoutingV1Ext (line 127) | type tabletsRoutingV1Ext struct
    method serialize (line 141) | func (ext *tabletsRoutingV1Ext) serialize() map[string]string {
    method name (line 147) | func (ext *tabletsRoutingV1Ext) name() string {
  function newTabletsRoutingV1Ext (line 134) | func newTabletsRoutingV1Ext(supported map[string][]string) *tabletsRouti...
  type rateLimitExt (line 156) | type rateLimitExt struct
    method serialize (line 190) | func (ext *rateLimitExt) serialize() map[string]string {
    method name (line 196) | func (ext *rateLimitExt) name() string {
  function newRateLimitExt (line 164) | func newRateLimitExt(supported map[string][]string, logger StdLogger) *r...
  type lwtAddMetadataMarkExt (line 210) | type lwtAddMetadataMarkExt struct
    method serialize (line 244) | func (ext *lwtAddMetadataMarkExt) serialize() map[string]string {
    method name (line 250) | func (ext *lwtAddMetadataMarkExt) name() string {
  function newLwtAddMetaMarkExt (line 218) | func newLwtAddMetaMarkExt(supported map[string][]string, logger StdLogge...
  function parseSupported (line 254) | func parseSupported(supported map[string][]string, logger StdLogger) Scy...
  function parseCQLProtocolExtensions (line 341) | func parseCQLProtocolExtensions(supported map[string][]string, logger St...
  method isScyllaConn (line 363) | func (c *Conn) isScyllaConn() bool {
  type scyllaConnPicker (line 379) | type scyllaConnPicker struct
    method Pick (line 421) | func (p *scyllaConnPicker) Pick(t Token, qry ExecutableQuery) *Conn {
    method maybeReplaceWithLessBusyConnection (line 472) | func (p *scyllaConnPicker) maybeReplaceWithLessBusyConnection(c *Conn)...
    method leastBusyConn (line 488) | func (p *scyllaConnPicker) leastBusyConn() *Conn {
    method shardOf (line 506) | func (p *scyllaConnPicker) shardOf(token int64Token) int {
    method Put (line 517) | func (p *scyllaConnPicker) Put(conn *Conn) error {
    method handleShardCountChange (line 577) | func (p *scyllaConnPicker) handleShardCountChange(newConn *Conn, newSh...
    method shouldCloseExcessConns (line 617) | func (p *scyllaConnPicker) shouldCloseExcessConns() bool {
    method GetConnectionCount (line 624) | func (p *scyllaConnPicker) GetConnectionCount() int {
    method GetExcessConnectionCount (line 628) | func (p *scyllaConnPicker) GetExcessConnectionCount() int {
    method GetShardCount (line 632) | func (p *scyllaConnPicker) GetShardCount() int {
    method Remove (line 636) | func (p *scyllaConnPicker) Remove(conn *Conn) {
    method InFlight (line 657) | func (p *scyllaConnPicker) InFlight() int {
    method Size (line 667) | func (p *scyllaConnPicker) Size() (int, int) {
    method Close (line 671) | func (p *scyllaConnPicker) Close() {
    method closeConns (line 676) | func (p *scyllaConnPicker) closeConns() {
    method closeExcessConns (line 694) | func (p *scyllaConnPicker) closeExcessConns() {
    method NextShard (line 725) | func (p *scyllaConnPicker) NextShard() (shardID, nrShards int) {
  function newScyllaConnPicker (line 396) | func newScyllaConnPicker(conn *Conn, logger StdLogger) *scyllaConnPicker {
  function isHeavyLoaded (line 484) | func isHeavyLoaded(c *Conn) bool {
  function closeConns (line 714) | func closeConns(conns ...*Conn) {
  type ShardDialer (line 756) | type ShardDialer interface
  type scyllaDialer (line 766) | type scyllaDialer struct
    method DialHost (line 775) | func (sd *scyllaDialer) DialHost(ctx context.Context, host *HostInfo) ...
    method DialShard (line 798) | func (sd *scyllaDialer) DialShard(ctx context.Context, host *HostInfo,...
    method dialShardAware (line 835) | func (sd *scyllaDialer) dialShardAware(ctx context.Context, addr, shar...
  constant scyllaShardAwarePortFallbackDuration (line 773) | scyllaShardAwarePortFallbackDuration time.Duration = 5 * time.Minute
  function isLocalAddrInUseErr (line 879) | func isLocalAddrInUseErr(err error) bool {
  type ScyllaShardAwareDialer (line 892) | type ScyllaShardAwareDialer struct
    method DialContext (line 896) | func (d *ScyllaShardAwareDialer) DialContext(ctx context.Context, netw...
  type scyllaPortIterator (line 910) | type scyllaPortIterator struct
    method Next (line 937) | func (spi *scyllaPortIterator) Next() (uint16, bool) {
  constant scyllaPortBasedBalancingMin (line 916) | scyllaPortBasedBalancingMin = 0x8000
  constant scyllaPortBasedBalancingMax (line 917) | scyllaPortBasedBalancingMax = 0xFFFF
  function newScyllaPortIterator (line 920) | func newScyllaPortIterator(shardID, shardCount int) *scyllaPortIterator {
  function scyllaShardForSourcePort (line 952) | func scyllaShardForSourcePort(sourcePort uint16, shardCount int) int {
  type scyllaSourcePortCtx (line 956) | type scyllaSourcePortCtx struct
  function ScyllaGetSourcePort (line 969) | func ScyllaGetSourcePort(ctx context.Context) uint16 {
  function scyllaGetTablePartitioner (line 976) | func scyllaGetTablePartitioner(session *Session, keyspaceName, tableName...

FILE: scylla_cdc.go
  constant scyllaCDCPartitionerName (line 14) | scyllaCDCPartitionerName     = "CDCPartitioner"
  constant scyllaCDCPartitionerFullName (line 15) | scyllaCDCPartitionerFullName = "com.scylladb.dht.CDCPartitioner"
  constant scyllaCDCPartitionKeyLength (line 17) | scyllaCDCPartitionKeyLength  = 16
  constant scyllaCDCVersionMask (line 18) | scyllaCDCVersionMask         = 0x0F
  constant scyllaCDCMinSupportedVersion (line 19) | scyllaCDCMinSupportedVersion = 1
  constant scyllaCDCMaxSupportedVersion (line 20) | scyllaCDCMaxSupportedVersion = 1
  constant scyllaCDCMinToken (line 22) | scyllaCDCMinToken           = int64Token(math.MinInt64)
  constant scyllaCDCLogTableNameSuffix (line 23) | scyllaCDCLogTableNameSuffix = "_scylla_cdc_log"
  constant scyllaCDCExtensionName (line 24) | scyllaCDCExtensionName      = "cdc"
  type scyllaCDCPartitioner (line 27) | type scyllaCDCPartitioner struct
    method Name (line 33) | func (p scyllaCDCPartitioner) Name() string {
    method Hash (line 37) | func (p scyllaCDCPartitioner) Hash(partitionKey []byte) Token {
    method ParseString (line 75) | func (p scyllaCDCPartitioner) ParseString(str string) Token {
  function scyllaIsCdcTable (line 79) | func scyllaIsCdcTable(session *Session, keyspaceName, tableName string) ...

FILE: scylla_shard_aware_port_common_test.go
  type makeClusterTestFunc (line 16) | type makeClusterTestFunc
  function testShardAwarePortNoReconnections (line 18) | func testShardAwarePortNoReconnections(t *testing.T, makeCluster makeClu...
  function testShardAwarePortMaliciousNAT (line 124) | func testShardAwarePortMaliciousNAT(t *testing.T, makeCluster makeCluste...
  function testShardAwarePortUnreachable (line 156) | func testShardAwarePortUnreachable(t *testing.T, makeCluster makeCluster...
  function testShardAwarePortUnusedIfNotEnabled (line 187) | func testShardAwarePortUnusedIfNotEnabled(t *testing.T, makeCluster make...
  function getShardAwarePort (line 230) | func getShardAwarePort(pool *hostConnPool, useTLS bool) uint16 {
  function triggerPoolsRefill (line 237) | func triggerPoolsRefill(sess *Session) {
  function waitUntilPoolsStopFilling (line 245) | func waitUntilPoolsStopFilling(ctx context.Context, sess *Session, timeo...
  function checkIfPoolsStoppedFilling (line 263) | func checkIfPoolsStoppedFilling(sess *Session) bool {
  function checkIfPoolsAreFull (line 280) | func checkIfPoolsAreFull(sess *Session) bool {
  function getClusterPort (line 297) | func getClusterPort(cluster *ClusterConfig) uint16 {
  type sourcePortOffByOneTestDialer (line 308) | type sourcePortOffByOneTestDialer struct
    method DialContext (line 312) | func (spobo *sourcePortOffByOneTestDialer) DialContext(ctx context.Con...
  type allowOnlyNonShardAwarePortDialer (line 325) | type allowOnlyNonShardAwarePortDialer struct
    method DialContext (line 331) | func (aonsa *allowOnlyNonShardAwarePortDialer) DialContext(ctx context...
  type loggingTestDialer (line 343) | type loggingTestDialer struct
    method DialContext (line 360) | func (ltd *loggingTestDialer) DialContext(ctx context.Context, network...
  type testConnectionEvent (line 350) | type testConnectionEvent struct
  function newLoggingTestDialer (line 354) | func newLoggingTestDialer() *loggingTestDialer {

FILE: scylla_shard_aware_port_integration_test.go
  function TestShardAwarePortIntegrationNoReconnections (line 8) | func TestShardAwarePortIntegrationNoReconnections(t *testing.T) {
  function TestShardAwarePortIntegrationMaliciousNAT (line 18) | func TestShardAwarePortIntegrationMaliciousNAT(t *testing.T) {
  function TestShardAwarePortIntegrationUnreachable (line 28) | func TestShardAwarePortIntegrationUnreachable(t *testing.T) {
  function TestShardAwarePortIntegrationUnusedIfNotEnabled (line 38) | func TestShardAwarePortIntegrationUnusedIfNotEnabled(t *testing.T) {

FILE: scylla_shard_aware_port_mocked_test.go
  constant testShardCount (line 16) | testShardCount = 3
  function TestShardAwarePortMockedNoReconnections (line 18) | func TestShardAwarePortMockedNoReconnections(t *testing.T) {
  function TestShardAwarePortMockedMaliciousNAT (line 24) | func TestShardAwarePortMockedMaliciousNAT(t *testing.T) {
  function TestShardAwarePortMockedUnreachable (line 30) | func TestShardAwarePortMockedUnreachable(t *testing.T) {
  function TestShardAwarePortMockedUnusedIfNotEnabled (line 36) | func TestShardAwarePortMockedUnusedIfNotEnabled(t *testing.T) {
  function testWithAndWithoutTLS (line 42) | func testWithAndWithoutTLS(t *testing.T, test func(t *testing.T, makeClu...
  function startServerWithShardAwarePort (line 56) | func startServerWithShardAwarePort(t testing.TB, useTLS bool) (makeClust...
  function mustParsePortFromAddr (line 134) | func mustParsePortFromAddr(addr string) uint16 {
  function getStandardScyllaExtensions (line 146) | func getStandardScyllaExtensions(shardID, shardCount int) map[string][]s...

FILE: scylla_test.go
  function TestScyllaConnPickerPickNilToken (line 23) | func TestScyllaConnPickerPickNilToken(t *testing.T) {
  function hammerConnPicker (line 72) | func hammerConnPicker(t *testing.T, wg *sync.WaitGroup, s *scyllaConnPic...
  function TestScyllaConnPickerHammerPickNilToken (line 82) | func TestScyllaConnPickerHammerPickNilToken(t *testing.T) {
 
Condensed preview — 375 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,234K chars).
[
  {
    "path": ".git-blame-ignore-revs",
    "chars": 160,
    "preview": "# Commit that replaced interface{} with any across the codebase.\n# Purely mechanical rename with no behavioral change.\n3"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 222,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: \"uv\"\n    directory: \"/docs\"\n    schedule:\n      interval: \"daily\"\n    allow:\n"
  },
  {
    "path": ".github/issue_template.md",
    "chars": 656,
    "preview": "Please answer these questions before submitting your issue. Thanks!\n\n### What version of ScyllaDB or Cassandra are you u"
  },
  {
    "path": ".github/workflows/bench-tests.yml",
    "chars": 673,
    "preview": "name: Run benchmark tests\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    types: [opened, synchronize, reo"
  },
  {
    "path": ".github/workflows/call_jira_sync.yml",
    "chars": 477,
    "preview": "name: Sync Jira Based on PR Events\n\non:\n  pull_request_target:\n    types: [opened, edited, ready_for_review, review_requ"
  },
  {
    "path": ".github/workflows/clean_dockerhub_images.yml",
    "chars": 834,
    "preview": "name: Docker Cleanup\n\non:\n  schedule:\n    - cron: '0 12 * * 1'  # Runs every Monday at noon (UTC)\n  workflow_dispatch:\n\n"
  },
  {
    "path": ".github/workflows/docs-pages.yml",
    "chars": 2529,
    "preview": "name: \"Docs / Publish\"\n# For more information,\n# see https://sphinx-theme.scylladb.com/stable/deployment/production.html"
  },
  {
    "path": ".github/workflows/docs-pr.yml",
    "chars": 1398,
    "preview": "name: \"Docs / Build PR\"\n# For more information,\n# see https://sphinx-theme.scylladb.com/stable/deployment/production.htm"
  },
  {
    "path": ".github/workflows/extended-ci-longevity-large-partitions-with-network-nemesis-1h-test.yml",
    "chars": 3666,
    "preview": "name: Build scylla-bench docker image with gocql PR\n\non:\n  pull_request_target:\n    types: [labeled]\n\njobs:\n  trigger-lo"
  },
  {
    "path": ".github/workflows/main.yml",
    "chars": 6972,
    "preview": "name: Build\n\non:\n  push:\n    branches:\n      - master\n    paths-ignore:\n      - \"*.md\"\n      - \"docs/**\"\n      - .github"
  },
  {
    "path": ".gitignore",
    "chars": 444,
    "preview": "gocql-fuzz\nfuzz-corpus\nfuzz-work\ngocql.test\n.idea\n\nbin/\n\ntestdata/pki/.keystore\ntestdata/pki/.truststore\ntestdata/pki/*."
  },
  {
    "path": ".golangci.yml",
    "chars": 703,
    "preview": "version: \"2\"\n\nformatters:\n  enable:\n    - goimports\n\n  settings:\n    goimports:\n      local-prefixes:\n        - github.c"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 4852,
    "preview": "# Contributing to the ScyllaDB GoCQL Driver\n\n**TL;DR** - this manifesto sets out the bare minimum requirements for submi"
  },
  {
    "path": "LICENSE",
    "chars": 11359,
    "preview": "\n                                 Apache License\n                           Version 2.0, January 2004\n                  "
  },
  {
    "path": "Makefile",
    "chars": 18325,
    "preview": "SHELL := bash\n.ONESHELL:\n.SHELLFLAGS := -eo pipefail -c\n\nMAKEFILE_PATH := $(abspath $(dir $(abspath $(lastword $(MAKEFIL"
  },
  {
    "path": "NOTICE",
    "chars": 7798,
    "preview": "ScyllaDB GoCQL Driver\nCopyright 2024 The Apache Software Foundation\n\nThis product includes software developed at\nThe Apa"
  },
  {
    "path": "README.md",
    "chars": 10543,
    "preview": "<div align=\"center\">\n\n![Build Passing](https://github.com/scylladb/gocql/workflows/Build/badge.svg)\n[![Read the Fork Dri"
  },
  {
    "path": "address_translators.go",
    "chars": 3258,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "address_translators_test.go",
    "chars": 4471,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "batch_test.go",
    "chars": 2544,
    "preview": "//go:build integration\n// +build integration\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or mor"
  },
  {
    "path": "callreq_wait.go",
    "chars": 105,
    "preview": "//go:build !race\n\npackage gocql\n\nfunc waitCallReqDone(call *callReq, where string) {\n\tcall.done.Wait()\n}\n"
  },
  {
    "path": "callreq_wait_race.go",
    "chars": 406,
    "preview": "//go:build race\n\npackage gocql\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\nfunc waitCallReqDone(call *callReq, where string) {\n\tdone := "
  },
  {
    "path": "cass1batch_test.go",
    "chars": 2786,
    "preview": "//go:build integration\n// +build integration\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or mor"
  },
  {
    "path": "cassandra_test.go",
    "chars": 108662,
    "preview": "//go:build integration\n// +build integration\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or mor"
  },
  {
    "path": "ci/clean-old-temporary-docker-images.py",
    "chars": 2125,
    "preview": "import os\nimport requests\nfrom datetime import datetime, timedelta\n\nDOCKERHUB_USERNAME = os.environ[\"DOCKERHUB_USERNAME\""
  },
  {
    "path": "client_routes.go",
    "chars": 20420,
    "preview": "package gocql\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"slices\"\n\t\"strings\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/gocql/"
  },
  {
    "path": "client_routes_test.go",
    "chars": 3898,
    "preview": "//go:build integration\n// +build integration\n\npackage gocql\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"sort\"\n\t\"testing\"\n\n\t\"github.com/goo"
  },
  {
    "path": "client_routes_unit_test.go",
    "chars": 17086,
    "preview": "//go:build unit\n// +build unit\n\npackage gocql\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"sync/atomic\"\n\t\"testing\"\n\t\"time\"\n)\n\ntyp"
  },
  {
    "path": "cloud_cluster_test.go",
    "chars": 7633,
    "preview": "//go:build integration\n// +build integration\n\npackage gocql_test\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"io"
  },
  {
    "path": "cluster.go",
    "chars": 25869,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "cluster_test.go",
    "chars": 4601,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "common_test.go",
    "chars": 18431,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "compressor.go",
    "chars": 1810,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "compressor_test.go",
    "chars": 5527,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "conn.go",
    "chars": 62046,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "conn_test.go",
    "chars": 68749,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "connectionpool.go",
    "chars": 14739,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "connectionpool_test.go",
    "chars": 6054,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "connpicker.go",
    "chars": 3555,
    "preview": "package gocql\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\t\"sync/atomic\"\n)\n\ntype ConnPicker interface {\n\tPick(Token, ExecutableQuery) *Conn"
  },
  {
    "path": "control.go",
    "chars": 15658,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "control_integration_test.go",
    "chars": 1609,
    "preview": "//go:build integration\n// +build integration\n\npackage gocql\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"testing\"\n)\n\n// unixSock"
  },
  {
    "path": "control_test.go",
    "chars": 2532,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "cqltypes.go",
    "chars": 1142,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "debounce/refresh_deboucer.go",
    "chars": 3133,
    "preview": "package debounce\n\nimport (\n\t\"sync\"\n\t\"time\"\n)\n\nconst (\n\tRingRefreshDebounceTime = 1 * time.Second\n)\n\n// debounces request"
  },
  {
    "path": "debounce/refresh_debouncer_test.go",
    "chars": 7111,
    "preview": "//go:build unit\n// +build unit\n\npackage debounce\n\nimport (\n\t\"errors\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"testing\"\n\t\"time\"\n)\n\n// Thi"
  },
  {
    "path": "debounce/simple_debouncer.go",
    "chars": 894,
    "preview": "package debounce\n\nimport (\n\t\"sync\"\n\t\"sync/atomic\"\n)\n\n// SimpleDebouncer is are tool for queuing immutable functions call"
  },
  {
    "path": "debounce/simple_debouncer_test.go",
    "chars": 4667,
    "preview": "//go:build unit\n// +build unit\n\npackage debounce\n\nimport (\n\t\"runtime\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"testing\"\n\t\"time\"\n)\n\n// Te"
  },
  {
    "path": "dial.go",
    "chars": 4161,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "dialer/recorder/recorder.go",
    "chars": 3734,
    "preview": "package recorder\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"path\"\n\t\"time\"\n\n\t\"github.com/gocql/goc"
  },
  {
    "path": "dialer/replayer/replayer.go",
    "chars": 5028,
    "preview": "package replayer\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"path\"\n\t\"time\"\n\n\t\"github.com/"
  },
  {
    "path": "dialer/utils.go",
    "chars": 4166,
    "preview": "package dialer\n\nimport (\n\tfrm \"github.com/gocql/gocql/internal/frame\"\n\t\"github.com/gocql/gocql/internal/murmur\"\n)\n\ntype "
  },
  {
    "path": "dns_test.go",
    "chars": 4456,
    "preview": "//go:build integration\n// +build integration\n\npackage gocql\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"sync\"\n\t\"testing\"\n)\n\ntype"
  },
  {
    "path": "doc.go",
    "chars": 20329,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "docs/Makefile",
    "chars": 2857,
    "preview": "SHELL=bash\n# Global variables\n# You can set these variables from the command line.\nUV            = uv\nSPHINXOPTS    = -j"
  },
  {
    "path": "docs/_utils/redirects.yaml",
    "chars": 154,
    "preview": "### a dictionary of redirects\n#old path: new path\n#\n\n# removing redirection html script files\n# test: /\n\n# /stable/test-"
  },
  {
    "path": "docs/pyproject.toml",
    "chars": 370,
    "preview": "[project]\nname = \"sphinx-docs\"\ndescription = \"ScyllaDB Documentation\"\nversion = \"0.1.0\"\nrequires-python = \">=3.11\"\ndepen"
  },
  {
    "path": "docs/source/conf.py",
    "chars": 4256,
    "preview": "# -*- coding: utf-8 -*-\nimport warnings\nfrom datetime import date\n\nfrom sphinx_scylladb_theme.utils import multiversion_"
  },
  {
    "path": "docs/source/index.rst",
    "chars": 110,
    "preview": "=====================\nScyllaDB gocql driver\n=====================\n\nLorem ipsum.\n\n.. toctree::\n\n    sample-page"
  },
  {
    "path": "docs/source/sample-page.rst",
    "chars": 49,
    "preview": "===========\nSample page\n===========\n\nLorem ipsum."
  },
  {
    "path": "errors.go",
    "chars": 7574,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "errors_test.go",
    "chars": 1885,
    "preview": "//go:build integration\n// +build integration\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or mor"
  },
  {
    "path": "events/event_converter.go",
    "chars": 2486,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "events/event_converter_test.go",
    "chars": 8719,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "events/events.go",
    "chars": 10067,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "events/events_test.go",
    "chars": 5628,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "events.go",
    "chars": 7732,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "events_test.go",
    "chars": 3909,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "events_unit_test.go",
    "chars": 50504,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "example_batch_test.go",
    "chars": 2802,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "example_dynamic_columns_test.go",
    "chars": 3803,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "example_lwt_batch_test.go",
    "chars": 3546,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "example_lwt_test.go",
    "chars": 2843,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "example_marshaler_test.go",
    "chars": 3515,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "example_nulls_test.go",
    "chars": 2490,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "example_paging_test.go",
    "chars": 3090,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "example_set_test.go",
    "chars": 2752,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "example_test.go",
    "chars": 2980,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "example_udt_map_test.go",
    "chars": 2435,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "example_udt_marshaler_test.go",
    "chars": 2671,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "example_udt_struct_test.go",
    "chars": 2476,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "example_udt_unmarshaler_test.go",
    "chars": 2832,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "exec.go",
    "chars": 2905,
    "preview": "package gocql\n\nimport (\n\t\"fmt\"\n)\n\n// SingleHostQueryExecutor allows to quickly execute diagnostic queries while\n// conne"
  },
  {
    "path": "exec_test.go",
    "chars": 472,
    "preview": "//go:build integration\n// +build integration\n\npackage gocql\n\nimport (\n\t\"testing\"\n)\n\nfunc TestSingleHostQueryExecutor(t *"
  },
  {
    "path": "export_test.go",
    "chars": 352,
    "preview": "//go:build integration\n// +build integration\n\npackage gocql\n\nvar FlagRunSslTest = flagRunSslTest\nvar FlagDistribution = "
  },
  {
    "path": "filters.go",
    "chars": 3641,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "filters_test.go",
    "chars": 6098,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "frame.go",
    "chars": 44861,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "frame_test.go",
    "chars": 7015,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "framer.go",
    "chars": 9019,
    "preview": "/*\n * Copyright (C) 2026 ScyllaDB\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not u"
  },
  {
    "path": "framer_bench_test.go",
    "chars": 1810,
    "preview": "//go:build bench\n// +build bench\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributo"
  },
  {
    "path": "go.mod",
    "chars": 1824,
    "preview": "//\n// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements.  See the NOT"
  },
  {
    "path": "go.sum",
    "chars": 3640,
    "preview": "github.com/bitly/go-hostpool v0.1.1 h1:SsovT4BFqgJQBAESkk2QgeeL7bqKq9oJie8JnD00R+Q=\ngithub.com/bitly/go-hostpool v0.1.1/"
  },
  {
    "path": "helpers.go",
    "chars": 17295,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "helpers_bench_test.go",
    "chars": 6951,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "host_source.go",
    "chars": 21048,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "host_source_scylla.go",
    "chars": 116,
    "preview": "package gocql\n\nfunc (h *HostInfo) SetDatacenter(dc string) {\n\th.mu.Lock()\n\tdefer h.mu.Unlock()\n\th.dataCenter = dc\n}\n"
  },
  {
    "path": "host_source_test.go",
    "chars": 25504,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "hostpolicy/hostpool.go",
    "chars": 3946,
    "preview": "package hostpolicy\n\nimport (\n\t\"sync\"\n\n\t\"github.com/hailocab/go-hostpool\"\n\n\t\"github.com/gocql/gocql\"\n)\n\n// HostPool is a "
  },
  {
    "path": "hostpolicy/hostpool_test.go",
    "chars": 1882,
    "preview": "package hostpolicy\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"testing\"\n\n\t\"github.com/hailocab/go-hostpool\"\n\n\t\"github.com/gocql/gocql\"\n)\n\n"
  },
  {
    "path": "install_test_deps.sh",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "integration.sh",
    "chars": 1187,
    "preview": "#!/bin/bash\n#\n# Copyright (C) 2017 ScyllaDB\n#\n\nreadonly SCYLLA_IMAGE=${SCYLLA_IMAGE}\n\nset -eu -o pipefail\n\nfunction scyl"
  },
  {
    "path": "integration_only.go",
    "chars": 1942,
    "preview": "//go:build integration\n// +build integration\n\npackage gocql\n\n// This file contains code to enable easy access to driver "
  },
  {
    "path": "integration_serialization_scylla_test.go",
    "chars": 30502,
    "preview": "//go:build integration\n// +build integration\n\npackage gocql\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"reflect\"\n\t\"strings\"\n"
  },
  {
    "path": "integration_test.go",
    "chars": 17342,
    "preview": "//go:build integration\n// +build integration\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or mor"
  },
  {
    "path": "internal/ccm/ccm.go",
    "chars": 4473,
    "preview": "//go:build ccm\n// +build ccm\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor li"
  },
  {
    "path": "internal/ccm/ccm_test.go",
    "chars": 1848,
    "preview": "//go:build all || ccm\n// +build all ccm\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more con"
  },
  {
    "path": "internal/debug/debug_off.go",
    "chars": 1130,
    "preview": "//go:build !gocql_debug\n// +build !gocql_debug\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or m"
  },
  {
    "path": "internal/debug/debug_on.go",
    "chars": 1127,
    "preview": "//go:build gocql_debug\n// +build gocql_debug\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or mor"
  },
  {
    "path": "internal/eventbus/README.md",
    "chars": 5583,
    "preview": "# EventBus\n\nA generic, thread-safe event processing package for Go based on channels. EventBus allows multiple subscribe"
  },
  {
    "path": "internal/eventbus/eventbus.go",
    "chars": 8150,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "internal/eventbus/eventbus_test.go",
    "chars": 11293,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "internal/eventbus/example_test.go",
    "chars": 5635,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "internal/frame/frames.go",
    "chars": 6603,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "internal/lru/lru.go",
    "chars": 4093,
    "preview": "/*\nCopyright 2015 To gocql authors\nCopyright 2013 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
  },
  {
    "path": "internal/lru/lru_test.go",
    "chars": 5331,
    "preview": "//go:build unit\n// +build unit\n\n/*\nCopyright 2015 To gocql authors\nCopyright 2013 Google Inc.\n\nLicensed under the Apache"
  },
  {
    "path": "internal/murmur/murmur.go",
    "chars": 3303,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "internal/murmur/murmur_appengine.go",
    "chars": 1324,
    "preview": "//go:build appengine || s390x\n// +build appengine s390x\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under on"
  },
  {
    "path": "internal/murmur/murmur_test.go",
    "chars": 5082,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "internal/murmur/murmur_unsafe.go",
    "chars": 1296,
    "preview": "//go:build !appengine && !s390x\n// +build !appengine,!s390x\n\n/*\n * Licensed to the Apache Software Foundation (ASF) unde"
  },
  {
    "path": "internal/streams/streams.go",
    "chars": 4297,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "internal/streams/streams_test.go",
    "chars": 5172,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "internal/tests/common.go",
    "chars": 1482,
    "preview": "package tests\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/google/uuid\"\n)\n\nfunc AssertTrue(t *testing"
  },
  {
    "path": "internal/tests/err_equal.go",
    "chars": 165,
    "preview": "package tests\n\nfunc ErrEqual(err1, err2 error) bool {\n\tif err1 != nil && err2 != nil {\n\t\treturn err1.Error() == err2.Err"
  },
  {
    "path": "internal/tests/mock/mock_framer.go",
    "chars": 454,
    "preview": "package mock\n\ntype MockFramer struct {\n\tData [][]byte\n\tpos  int\n}\n\nfunc (m *MockFramer) ReadBytesInternal() ([]byte, err"
  },
  {
    "path": "internal/tests/rand.go",
    "chars": 3899,
    "preview": "package tests\n\nimport (\n\t\"math/rand\"\n\t\"sync\"\n\t\"time\"\n)\n\n// RandInterface defines the thread-safe random number generator"
  },
  {
    "path": "internal/tests/serialization/mod/all.go",
    "chars": 313,
    "preview": "package mod\n\nvar All = []Mod{CustomType, Reference, CustomTypeRef}\n\n// Mod - value modifiers.\ntype Mod func(vals ...any)"
  },
  {
    "path": "internal/tests/serialization/mod/custom.go",
    "chars": 5000,
    "preview": "package mod\n\ntype (\n\tBool bool\n\n\tInt8  int8\n\tInt16 int16\n\tInt32 int32\n\tInt64 int64\n\tInt   int\n\n\tUint8  uint8\n\tUint16 uin"
  },
  {
    "path": "internal/tests/serialization/mod/custom_refs.go",
    "chars": 107,
    "preview": "package mod\n\nvar CustomTypeRef Mod = func(vals ...any) []any {\n\treturn Reference(CustomType(vals...)...)\n}\n"
  },
  {
    "path": "internal/tests/serialization/mod/refs.go",
    "chars": 355,
    "preview": "package mod\n\nimport \"reflect\"\n\nvar Reference Mod = func(vals ...any) []any {\n\tout := make([]any, 0)\n\tfor i := range vals"
  },
  {
    "path": "internal/tests/serialization/pointers.go",
    "chars": 1654,
    "preview": "package serialization\n\nimport (\n\t\"errors\"\n\t\"reflect\"\n)\n\n// errFirstPtrChanged this error indicates that a double or sing"
  },
  {
    "path": "internal/tests/serialization/pointers_test.go",
    "chars": 1154,
    "preview": "//go:build unit\n// +build unit\n\npackage serialization\n\nimport \"testing\"\n\nfunc Test1Pointers(t *testing.T) {\n\tt.Parallel("
  },
  {
    "path": "internal/tests/serialization/set_negative_marshal.go",
    "chars": 1353,
    "preview": "package serialization\n\nimport (\n\t\"errors\"\n\t\"reflect\"\n\t\"runtime/debug\"\n\t\"testing\"\n)\n\n// NegativeMarshalSet is a tool for "
  },
  {
    "path": "internal/tests/serialization/set_negative_unmarshal.go",
    "chars": 1941,
    "preview": "package serialization\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"runtime/debug\"\n\t\"testing\"\n)\n\n// NegativeUnmarshal"
  },
  {
    "path": "internal/tests/serialization/set_positive.go",
    "chars": 3242,
    "preview": "package serialization\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"runtime/debug\"\n\t\"testing\"\n)\n\n// PositiveSet is a "
  },
  {
    "path": "internal/tests/serialization/utils.go",
    "chars": 496,
    "preview": "package serialization\n\nimport (\n\t\"reflect\"\n)\n\nfunc GetTypes(values ...any) []reflect.Type {\n\ttypes := make([]reflect.Typ"
  },
  {
    "path": "internal/tests/serialization/utils_equal.go",
    "chars": 2175,
    "preview": "package serialization\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"reflect\"\n\t\"unsafe\"\n\n\t\"gopkg.in/inf.v0\"\n\n\t\"github.com/gocql"
  },
  {
    "path": "internal/tests/serialization/utils_error.go",
    "chars": 502,
    "preview": "package serialization\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\nvar unmarshalErr = errors.New(\"unmarshal unexpectedly failed with er"
  },
  {
    "path": "internal/tests/serialization/utils_new.go",
    "chars": 312,
    "preview": "package serialization\n\nimport (\n\t\"reflect\"\n)\n\nfunc newRef(in any) any {\n\tout := reflect.New(reflect.TypeOf(in)).Interfac"
  },
  {
    "path": "internal/tests/serialization/utils_str.go",
    "chars": 1172,
    "preview": "package serialization\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n\t\"net\"\n\t\"reflect\"\n\t\"time\"\n\n\t\"gopkg.in/inf.v0\"\n)\n\nconst printLimit = 1"
  },
  {
    "path": "internal/tests/serialization/valcases/get.go",
    "chars": 534,
    "preview": "package valcases\n\nimport (\n\t\"reflect\"\n)\n\ntype SimpleTypes []SimpleTypeCases\n\ntype SimpleTypeCases struct {\n\tCQLName stri"
  },
  {
    "path": "internal/tests/serialization/valcases/simple.go",
    "chars": 22887,
    "preview": "package valcases\n\nimport (\n\t\"math\"\n\t\"math/big\"\n\t\"net\"\n\t\"time\"\n\n\t\"gopkg.in/inf.v0\"\n\n\t\"github.com/gocql/gocql/serializatio"
  },
  {
    "path": "keyspace_table_test.go",
    "chars": 3217,
    "preview": "//go:build integration\n// +build integration\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or mor"
  },
  {
    "path": "logger.go",
    "chars": 2020,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "lz4/go.mod",
    "chars": 1082,
    "preview": "//\n// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements.  See the NOT"
  },
  {
    "path": "lz4/go.sum",
    "chars": 1054,
    "preview": "github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=\ngithub.com/davecgh/go-spew v1.1.1/go.m"
  },
  {
    "path": "lz4/lz4.go",
    "chars": 2776,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "lz4/lz4_bench_test.go",
    "chars": 324,
    "preview": "//go:build bench\n// +build bench\n\npackage lz4\n\nimport (\n\t\"testing\"\n)\n\nfunc BenchmarkLZ4Compressor(b *testing.B) {\n\torigi"
  },
  {
    "path": "lz4/lz4_test.go",
    "chars": 1881,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "marshal.go",
    "chars": 58480,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "marshal_test.go",
    "chars": 32817,
    "preview": "//go:build unit\n// +build unit\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor "
  },
  {
    "path": "metadata_scylla.go",
    "chars": 49019,
    "preview": "// Copyright (c) 2015 The gocql Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// l"
  },
  {
    "path": "metadata_scylla_test.go",
    "chars": 15662,
    "preview": "//go:build unit\n// +build unit\n\n// Copyright (c) 2015 The gocql Authors. All rights reserved.\n// Use of this source code"
  },
  {
    "path": "policies.go",
    "chars": 36950,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "policies_bench_test.go",
    "chars": 5541,
    "preview": "//go:build unit\n// +build unit\n\npackage gocql\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"net\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"github.com/gocql/"
  },
  {
    "path": "policies_integration_test.go",
    "chars": 4922,
    "preview": "//go:build integration\n// +build integration\n\npackage gocql\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n)\n\n// Check if sessi"
  },
  {
    "path": "policies_test.go",
    "chars": 50846,
    "preview": "// Copyright (c) 2015 The gocql Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// l"
  },
  {
    "path": "prepared_cache.go",
    "chars": 3019,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "query_error_test.go",
    "chars": 3232,
    "preview": "//go:build unit\n// +build unit\n\npackage gocql\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestQueryError_PotentiallyE"
  },
  {
    "path": "query_executor.go",
    "chars": 8266,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOT"
  },
  {
    "path": "recreate.go",
    "chars": 13131,
    "preview": "// Copyright (C) 2017 ScyllaDB\n\npackage gocql\n\nimport (\n\t\"encoding/binary\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"sort\"\n\t\"strco"
  },
  {
    "path": "recreate_test.go",
    "chars": 9078,
    "preview": "//go:build integration\n// +build integration\n\n// Copyright (C) 2017 ScyllaDB\n\npackage gocql\n\nimport (\n\t\"context\"\n\t\"encod"
  },
  {
    "path": "renovate.json",
    "chars": 140,
    "preview": "{\n  \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n  \"extends\": [\n    \"config:recommended\"\n  ],\n  \"prCo"
  },
  {
    "path": "ring_describer.go",
    "chars": 5210,
    "preview": "package gocql\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync\"\n)\n\n// Polls system.peers at a specific interval to find new hosts\ntype"
  },
  {
    "path": "ring_describer_test.go",
    "chars": 13361,
    "preview": "//go:build unit\n// +build unit\n\npackage gocql\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gocql/"
  },
  {
    "path": "schema_queries_test.go",
    "chars": 658,
    "preview": "//go:build integration\n// +build integration\n\npackage gocql\n\nimport (\n\t\"testing\"\n\n\t\"github.com/gocql/gocql/internal/test"
  },
  {
    "path": "scylla.go",
    "chars": 28569,
    "preview": "package gocql\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"net\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync/atomic\"\n\t\""
  },
  {
    "path": "scylla_cdc.go",
    "chars": 2477,
    "preview": "package gocql\n\nimport (\n\t\"encoding/binary\"\n\t\"math\"\n\t\"strings\"\n\n\t\"github.com/gocql/gocql/internal/debug\"\n)\n\n// cdc partit"
  },
  {
    "path": "scylla_shard_aware_port_common_test.go",
    "chars": 10458,
    "preview": "//go:build integration || unit\n// +build integration unit\n\npackage gocql\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n\t"
  },
  {
    "path": "scylla_shard_aware_port_integration_test.go",
    "chars": 870,
    "preview": "//go:build integration\n// +build integration\n\npackage gocql\n\nimport \"testing\"\n\nfunc TestShardAwarePortIntegrationNoRecon"
  },
  {
    "path": "scylla_shard_aware_port_mocked_test.go",
    "chars": 4320,
    "preview": "//go:build unit\n// +build unit\n\npackage gocql\n\nimport (\n\t\"context\"\n\t\"math/rand\"\n\t\"net\"\n\t\"strconv\"\n\t\"sync/atomic\"\n\t\"testi"
  },
  {
    "path": "scylla_test.go",
    "chars": 12273,
    "preview": "//go:build unit\n// +build unit\n\npackage gocql\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"math\"\n\t\"net\"\n\t\"runtime\"\n\t\"sync\"\n\t\"sync/atomi"
  },
  {
    "path": "scylla_tokens_test.go",
    "chars": 273853,
    "preview": "package gocql\n\nvar scyllaShardOfTests = []struct {\n\ttoken int64\n\tshard int\n}{\n\t{-9219783007514621794, 3},\n\t{-92189101619"
  },
  {
    "path": "scyllacloud/cluster.go",
    "chars": 3854,
    "preview": "// Copyright (C) 2021 ScyllaDB\n\npackage scyllacloud\n\nimport (\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\n\t\"sigs.k8s.io/yaml\"\n\n\t\""
  },
  {
    "path": "scyllacloud/config.go",
    "chars": 8857,
    "preview": "package scyllacloud\n\nimport (\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype ConnectionConfig struct {\n\t// Datacenter"
  },
  {
    "path": "scyllacloud/config_test.go",
    "chars": 14485,
    "preview": "// Copyright (C) 2021 ScyllaDB\n\n//go:build unit\n// +build unit\n\npackage scyllacloud\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\""
  },
  {
    "path": "scyllacloud/hostdialer.go",
    "chars": 3929,
    "preview": "// Copyright (C) 2021 ScyllaDB\n\npackage scyllacloud\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/url\"\n\n\t\"golan"
  },
  {
    "path": "scyllacloud/hostdialer_test.go",
    "chars": 12547,
    "preview": "//go:build unit\n// +build unit\n\npackage scyllacloud\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"crypto/rand\"\n\t\"crypto/rsa\"\n\t\"crypto/"
  },
  {
    "path": "serialization/ascii/marshal.go",
    "chars": 590,
    "preview": "package ascii\n\nimport (\n\t\"reflect\"\n)\n\nfunc Marshal(value any) ([]byte, error) {\n\tswitch v := value.(type) {\n\tcase nil:\n\t"
  },
  {
    "path": "serialization/ascii/marshal_utils.go",
    "chars": 1396,
    "preview": "package ascii\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\nfunc EncString(v string) ([]byte, error) {\n\treturn encString(v), nil\n}\n\nfun"
  },
  {
    "path": "serialization/ascii/unmarshal.go",
    "chars": 824,
    "preview": "package ascii\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\nfunc Unmarshal(data []byte, value any) error {\n\tswitch v := value.(type) {\n"
  },
  {
    "path": "serialization/ascii/unmarshal_utils.go",
    "chars": 3589,
    "preview": "package ascii\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\nfunc errInvalidData(p []byte) error {\n\tfor i := range p {\n\t\tif p[i] > 127 {"
  },
  {
    "path": "serialization/bigint/marshal.go",
    "chars": 1333,
    "preview": "package bigint\n\nimport (\n\t\"math/big\"\n\t\"reflect\"\n)\n\nfunc Marshal(value any) ([]byte, error) {\n\tswitch v := value.(type) {"
  },
  {
    "path": "serialization/bigint/marshal_utils.go",
    "chars": 4810,
    "preview": "package bigint\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nconst supportedTypes = \"~int8, ~int16, ~int32, ~int"
  },
  {
    "path": "serialization/bigint/unmarshal.go",
    "chars": 1685,
    "preview": "package bigint\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n\t\"reflect\"\n)\n\nfunc Unmarshal(data []byte, value any) error {\n\tswitch v := va"
  },
  {
    "path": "serialization/bigint/unmarshal_utils.go",
    "chars": 18468,
    "preview": "package bigint\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nvar errWrongDataLen = fmt.Errorf(\"failed to"
  },
  {
    "path": "serialization/blob/marshal.go",
    "chars": 589,
    "preview": "package blob\n\nimport (\n\t\"reflect\"\n)\n\nfunc Marshal(value any) ([]byte, error) {\n\tswitch v := value.(type) {\n\tcase nil:\n\t\t"
  },
  {
    "path": "serialization/blob/marshal_utils.go",
    "chars": 1392,
    "preview": "package blob\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\nfunc EncString(v string) ([]byte, error) {\n\treturn encString(v), nil\n}\n\nfunc"
  },
  {
    "path": "serialization/blob/unmarshal.go",
    "chars": 865,
    "preview": "package blob\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\nfunc Unmarshal(data []byte, value any) error {\n\tswitch v := value.(type) {\n\t"
  },
  {
    "path": "serialization/blob/unmarshal_utils.go",
    "chars": 3487,
    "preview": "package blob\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\nfunc errNilReference(v any) error {\n\treturn fmt.Errorf(\"failed to unmarshal "
  },
  {
    "path": "serialization/blob/unmarshal_utils_test.go",
    "chars": 1899,
    "preview": "//go:build unit\n// +build unit\n\npackage blob\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\nfunc TestDecBytesArrayBackedSlice(t *testi"
  },
  {
    "path": "serialization/boolean/marshal.go",
    "chars": 539,
    "preview": "package boolean\n\nimport (\n\t\"reflect\"\n)\n\nfunc Marshal(value any) ([]byte, error) {\n\tswitch v := value.(type) {\n\tcase nil:"
  },
  {
    "path": "serialization/boolean/marshal_utils.go",
    "chars": 934,
    "preview": "package boolean\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\nfunc EncBool(v bool) ([]byte, error) {\n\treturn encBool(v), nil\n}\n\nfunc En"
  },
  {
    "path": "serialization/boolean/unmarshal.go",
    "chars": 695,
    "preview": "package boolean\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\nfunc Unmarshal(data []byte, value any) error {\n\tswitch v := value.(type) "
  },
  {
    "path": "serialization/boolean/unmarshal_utils.go",
    "chars": 2048,
    "preview": "package boolean\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\nvar errWrongDataLen = fmt.Errorf(\"failed to unmarshal boolean: the length"
  },
  {
    "path": "serialization/counter/marshal.go",
    "chars": 1334,
    "preview": "package counter\n\nimport (\n\t\"math/big\"\n\t\"reflect\"\n)\n\nfunc Marshal(value any) ([]byte, error) {\n\tswitch v := value.(type) "
  },
  {
    "path": "serialization/counter/marshal_utils.go",
    "chars": 4809,
    "preview": "package counter\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nconst supportedTypes = \"~int8, ~int16, ~int32, ~in"
  },
  {
    "path": "serialization/counter/unmarshal.go",
    "chars": 1687,
    "preview": "package counter\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n\t\"reflect\"\n)\n\nfunc Unmarshal(data []byte, value any) error {\n\tswitch v := v"
  },
  {
    "path": "serialization/counter/unmarshal_utils.go",
    "chars": 18498,
    "preview": "package counter\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nvar errWrongDataLen = fmt.Errorf(\"failed t"
  },
  {
    "path": "serialization/cqlint/marshal.go",
    "chars": 1333,
    "preview": "package cqlint\n\nimport (\n\t\"math/big\"\n\t\"reflect\"\n)\n\nfunc Marshal(value any) ([]byte, error) {\n\tswitch v := value.(type) {"
  },
  {
    "path": "serialization/cqlint/marshal_utils.go",
    "chars": 5834,
    "preview": "package cqlint\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nconst supportedTypes = \"~int8, ~int16, ~int"
  }
]

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

About this extraction

This page contains the full source code of the scylladb/gocql GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 375 files (2.8 MB), approximately 753.7k tokens, and a symbol index with 4195 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!