{
  "$schema": "/products/haybarn/functions/api/v1/function.schema.json",
  "schemaVersion": 1,
  "name": "~",
  "schema": "main",
  "slug": "operator-7e",
  "description": "Bitwise NOT",
  "category": "operators",
  "kinds": [
    "scalar"
  ],
  "aliasOf": [],
  "snapshot": {
    "schemaVersion": 1,
    "id": "duckdb-1.5.5",
    "engine": "duckdb",
    "label": "DuckDB 1.5.5",
    "engineVersion": "v1.5.5",
    "sourceId": "d8cdaa33fd",
    "source": "https://github.com/duckdb/duckdb/releases/tag/v1.5.5",
    "binarySha256": "8463eb26527b278109cfddffc4606e1019ebefcfe2eac75efc53c76ed8f282d5",
    "capturedAt": "2026-09-05T18:37:40.699Z",
    "requestedExtensions": [
      "core_functions",
      "icu",
      "json",
      "parquet"
    ],
    "loadedExtensions": [
      {
        "extension_name": "autocomplete",
        "extension_version": "v1.5.5",
        "installed_from": ""
      },
      {
        "extension_name": "core_functions",
        "extension_version": "v1.5.5",
        "installed_from": "core"
      },
      {
        "extension_name": "icu",
        "extension_version": "v1.5.5",
        "installed_from": "core"
      },
      {
        "extension_name": "json",
        "extension_version": "v1.5.5",
        "installed_from": "core"
      },
      {
        "extension_name": "parquet",
        "extension_version": "v1.5.5",
        "installed_from": "core"
      },
      {
        "extension_name": "shell",
        "extension_version": "v1.5.5",
        "installed_from": ""
      }
    ],
    "scope": "Built-in functions in the main schema, with the requested extensions loaded. Catalog visibility is not a guarantee of browser support."
  },
  "links": {
    "html": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/",
    "markdown": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/index.md",
    "json": "/products/haybarn/functions/api/v1/duckdb-1.5.5/functions/operator-7e.json"
  },
  "interpretation": [
    "Choose a snapshot matching the target engine and build. The default is captured from the published Haybarn WASM package used by the browser playground. Historical native snapshots are also available.",
    "Availability is an observation in the recorded build and extension profile, not a guarantee of support in every installation or in WASM.",
    "Types and descriptions are declarations from duckdb_functions(). Binding can specialize result types. Null means not supplied by the catalog; do not invent defaults, optionality, argument mode, or table output columns.",
    "Raw parameter arrays preserve catalog order for scalar/aggregate/macro functions. Raw table arguments are alphabetical. Use callingConvention for engine-confirmed positional order and named arguments; null modes are unrecorded. Named does not mean optional. Macro defaults and special named variadic behavior are not supplied by duckdb_functions().",
    "Catalog examples are source material and may require data or extensions. runnableExamples contains separately verified SQL for the pinned WASM package; sample-data adaptations and guide examples are labeled separately.",
    "Guide annotations and recipes are separate editorial content. The browser runner always uses Haybarn WASM 1.5.5-rc3, independently of the documentation snapshot.",
    "All URLs beginning with / are relative to the origin hosting this document. Exports require no JavaScript, cookies, API key, or browser engine."
  ],
  "overloads": [
    {
      "id": "overload-e946c2b4006d5242",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/#overload-e946c2b4006d5242",
      "signature": "~input: BIGINT → BIGINT",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "input",
            "type": "BIGINT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "operator",
        "operator": {
          "symbol": "~",
          "form": "prefix",
          "operands": [
            "input"
          ],
          "expression": "~input"
        }
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "~",
        "function_type": "scalar",
        "description": "Bitwise NOT",
        "comment": null,
        "return_type": "BIGINT",
        "parameters": [
          "input"
        ],
        "parameter_types": [
          "BIGINT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "~15"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-cfe5938f3eb441a8",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/#overload-cfe5938f3eb441a8",
      "signature": "~input: BIT → BIT",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "input",
            "type": "BIT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "operator",
        "operator": {
          "symbol": "~",
          "form": "prefix",
          "operands": [
            "input"
          ],
          "expression": "~input"
        }
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "~",
        "function_type": "scalar",
        "description": "Bitwise NOT",
        "comment": null,
        "return_type": "BIT",
        "parameters": [
          "input"
        ],
        "parameter_types": [
          "BIT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "~15"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-ef0fa20dbd040b38",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/#overload-ef0fa20dbd040b38",
      "signature": "~input: HUGEINT → HUGEINT",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "input",
            "type": "HUGEINT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "operator",
        "operator": {
          "symbol": "~",
          "form": "prefix",
          "operands": [
            "input"
          ],
          "expression": "~input"
        }
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "~",
        "function_type": "scalar",
        "description": "Bitwise NOT",
        "comment": null,
        "return_type": "HUGEINT",
        "parameters": [
          "input"
        ],
        "parameter_types": [
          "HUGEINT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "~15"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-f202eb08c12562fd",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/#overload-f202eb08c12562fd",
      "signature": "~input: INTEGER → INTEGER",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "input",
            "type": "INTEGER",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "operator",
        "operator": {
          "symbol": "~",
          "form": "prefix",
          "operands": [
            "input"
          ],
          "expression": "~input"
        }
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "~",
        "function_type": "scalar",
        "description": "Bitwise NOT",
        "comment": null,
        "return_type": "INTEGER",
        "parameters": [
          "input"
        ],
        "parameter_types": [
          "INTEGER"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "~15"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-6bc6f5ac6f823c0b",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/#overload-6bc6f5ac6f823c0b",
      "signature": "~input: SMALLINT → SMALLINT",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "input",
            "type": "SMALLINT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "operator",
        "operator": {
          "symbol": "~",
          "form": "prefix",
          "operands": [
            "input"
          ],
          "expression": "~input"
        }
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "~",
        "function_type": "scalar",
        "description": "Bitwise NOT",
        "comment": null,
        "return_type": "SMALLINT",
        "parameters": [
          "input"
        ],
        "parameter_types": [
          "SMALLINT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "~15"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-77c4a17e6f3cb0ef",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/#overload-77c4a17e6f3cb0ef",
      "signature": "~input: TINYINT → TINYINT",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "input",
            "type": "TINYINT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "operator",
        "operator": {
          "symbol": "~",
          "form": "prefix",
          "operands": [
            "input"
          ],
          "expression": "~input"
        }
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "~",
        "function_type": "scalar",
        "description": "Bitwise NOT",
        "comment": null,
        "return_type": "TINYINT",
        "parameters": [
          "input"
        ],
        "parameter_types": [
          "TINYINT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "~15"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-7febcef00740c3bd",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/#overload-7febcef00740c3bd",
      "signature": "~input: UBIGINT → UBIGINT",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "input",
            "type": "UBIGINT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "operator",
        "operator": {
          "symbol": "~",
          "form": "prefix",
          "operands": [
            "input"
          ],
          "expression": "~input"
        }
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "~",
        "function_type": "scalar",
        "description": "Bitwise NOT",
        "comment": null,
        "return_type": "UBIGINT",
        "parameters": [
          "input"
        ],
        "parameter_types": [
          "UBIGINT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "~15"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-55cbbb455417d2c5",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/#overload-55cbbb455417d2c5",
      "signature": "~input: UHUGEINT → UHUGEINT",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "input",
            "type": "UHUGEINT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "operator",
        "operator": {
          "symbol": "~",
          "form": "prefix",
          "operands": [
            "input"
          ],
          "expression": "~input"
        }
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "~",
        "function_type": "scalar",
        "description": "Bitwise NOT",
        "comment": null,
        "return_type": "UHUGEINT",
        "parameters": [
          "input"
        ],
        "parameter_types": [
          "UHUGEINT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "~15"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-96bb9dd71c2d97ea",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/#overload-96bb9dd71c2d97ea",
      "signature": "~input: UINTEGER → UINTEGER",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "input",
            "type": "UINTEGER",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "operator",
        "operator": {
          "symbol": "~",
          "form": "prefix",
          "operands": [
            "input"
          ],
          "expression": "~input"
        }
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "~",
        "function_type": "scalar",
        "description": "Bitwise NOT",
        "comment": null,
        "return_type": "UINTEGER",
        "parameters": [
          "input"
        ],
        "parameter_types": [
          "UINTEGER"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "~15"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-22d7cc77c8b693db",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/#overload-22d7cc77c8b693db",
      "signature": "~input: USMALLINT → USMALLINT",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "input",
            "type": "USMALLINT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "operator",
        "operator": {
          "symbol": "~",
          "form": "prefix",
          "operands": [
            "input"
          ],
          "expression": "~input"
        }
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "~",
        "function_type": "scalar",
        "description": "Bitwise NOT",
        "comment": null,
        "return_type": "USMALLINT",
        "parameters": [
          "input"
        ],
        "parameter_types": [
          "USMALLINT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "~15"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    },
    {
      "id": "overload-5f3ec58af799e00e",
      "url": "/products/haybarn/functions/releases/duckdb-1.5.5/operator-7e/#overload-5f3ec58af799e00e",
      "signature": "~input: UTINYINT → UTINYINT",
      "parameterOrder": "catalog-order",
      "callingConvention": {
        "source": null,
        "parameters": [
          {
            "name": "input",
            "type": "UTINYINT",
            "mode": null,
            "position": null
          }
        ],
        "positional": null,
        "named": null,
        "variadic": null,
        "evidence": null
      },
      "syntax": {
        "kind": "operator",
        "operator": {
          "symbol": "~",
          "form": "prefix",
          "operands": [
            "input"
          ],
          "expression": "~input"
        }
      },
      "catalog": {
        "schema_name": "main",
        "function_name": "~",
        "function_type": "scalar",
        "description": "Bitwise NOT",
        "comment": null,
        "return_type": "UTINYINT",
        "parameters": [
          "input"
        ],
        "parameter_types": [
          "UTINYINT"
        ],
        "varargs": null,
        "macro_definition": null,
        "has_side_effects": false,
        "internal": true,
        "examples": [
          "~15"
        ],
        "stability": "CONSISTENT",
        "categories": [],
        "alias_of": null
      }
    }
  ],
  "editorial": {
    "argumentNotes": [],
    "recipes": []
  },
  "examples": [
    {
      "original": "~15",
      "sql": "SELECT ~15;",
      "overloadIds": [
        "overload-e946c2b4006d5242",
        "overload-cfe5938f3eb441a8",
        "overload-ef0fa20dbd040b38",
        "overload-f202eb08c12562fd",
        "overload-6bc6f5ac6f823c0b",
        "overload-77c4a17e6f3cb0ef",
        "overload-7febcef00740c3bd",
        "overload-55cbbb455417d2c5",
        "overload-96bb9dd71c2d97ea",
        "overload-22d7cc77c8b693db",
        "overload-5f3ec58af799e00e"
      ],
      "source": "engine-catalog",
      "verification": null
    }
  ],
  "translations": [
    {
      "function": "~",
      "scope": "",
      "relation": "direct",
      "source": {
        "engine": "Snowflake",
        "dialect": "snowflake",
        "name": "bitnot",
        "names": [
          "bitnot"
        ],
        "sql": "SELECT BITNOT(-1)"
      },
      "target": {
        "dialect": "duckdb",
        "name": "~",
        "sql": "SELECT ~(-1)"
      },
      "formatTokens": [],
      "executionVerified": false,
      "provenance": {
        "name": "SQLGlot",
        "commit": "3086608e6fd4c41c02dfba47171608d2b193fce2",
        "url": "https://github.com/tobymao/sqlglot/blob/3086608e6fd4c41c02dfba47171608d2b193fce2/tests/dialects/test_snowflake.py#L2382"
      }
    }
  ],
  "runnableExamples": [
    {
      "function": "~",
      "original": "~15",
      "sql": "SELECT ~15;",
      "source": "engine-catalog",
      "verification": {
        "engine": "haybarn-wasm",
        "packageVersion": "1.5.5-rc3",
        "sourceId": "105edd31b5",
        "binarySha256": "426638bc374fcc542fea93b251f885bfb7d221c68fcc0a5a81cc565d7e6ca180",
        "rowCount": 1
      }
    }
  ],
  "additionalDocumentation": [
    {
      "title": "Functions",
      "url": "https://duckdb.org/docs/current/sql/functions/overview"
    }
  ],
  "availability": [
    {
      "snapshot": "haybarn-1.5.5-rc3",
      "observed": true,
      "overloadCount": 11,
      "matchingOverloadIds": [
        "overload-e946c2b4006d5242",
        "overload-cfe5938f3eb441a8",
        "overload-ef0fa20dbd040b38",
        "overload-f202eb08c12562fd",
        "overload-6bc6f5ac6f823c0b",
        "overload-77c4a17e6f3cb0ef",
        "overload-7febcef00740c3bd",
        "overload-55cbbb455417d2c5",
        "overload-96bb9dd71c2d97ea",
        "overload-22d7cc77c8b693db",
        "overload-5f3ec58af799e00e"
      ],
      "json": "/products/haybarn/functions/api/v1/haybarn-1.5.5-rc3/functions/operator-7e.json"
    },
    {
      "snapshot": "duckdb-1.5.5",
      "observed": true,
      "overloadCount": 11,
      "matchingOverloadIds": [
        "overload-e946c2b4006d5242",
        "overload-cfe5938f3eb441a8",
        "overload-ef0fa20dbd040b38",
        "overload-f202eb08c12562fd",
        "overload-6bc6f5ac6f823c0b",
        "overload-77c4a17e6f3cb0ef",
        "overload-7febcef00740c3bd",
        "overload-55cbbb455417d2c5",
        "overload-96bb9dd71c2d97ea",
        "overload-22d7cc77c8b693db",
        "overload-5f3ec58af799e00e"
      ],
      "json": "/products/haybarn/functions/api/v1/duckdb-1.5.5/functions/operator-7e.json"
    },
    {
      "snapshot": "duckdb-1.4.4",
      "observed": true,
      "overloadCount": 11,
      "matchingOverloadIds": [
        "overload-e946c2b4006d5242",
        "overload-cfe5938f3eb441a8",
        "overload-ef0fa20dbd040b38",
        "overload-f202eb08c12562fd",
        "overload-6bc6f5ac6f823c0b",
        "overload-77c4a17e6f3cb0ef",
        "overload-7febcef00740c3bd",
        "overload-55cbbb455417d2c5",
        "overload-96bb9dd71c2d97ea",
        "overload-22d7cc77c8b693db",
        "overload-5f3ec58af799e00e"
      ],
      "json": "/products/haybarn/functions/api/v1/duckdb-1.4.4/functions/operator-7e.json"
    },
    {
      "snapshot": "duckdb-1.3.2",
      "observed": true,
      "overloadCount": 11,
      "matchingOverloadIds": [
        "overload-e946c2b4006d5242",
        "overload-cfe5938f3eb441a8",
        "overload-ef0fa20dbd040b38",
        "overload-f202eb08c12562fd",
        "overload-6bc6f5ac6f823c0b",
        "overload-77c4a17e6f3cb0ef",
        "overload-7febcef00740c3bd",
        "overload-55cbbb455417d2c5",
        "overload-96bb9dd71c2d97ea",
        "overload-22d7cc77c8b693db",
        "overload-5f3ec58af799e00e"
      ],
      "json": "/products/haybarn/functions/api/v1/duckdb-1.3.2/functions/operator-7e.json"
    }
  ]
}
