File: autoloading_types.test

package info (click to toggle)
duckdb 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 558
file content (42 lines) | stat: -rw-r--r-- 1,123 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# name: test/extension/autoloading_types.test
# description: Tests for autoloading with types
# group: [extension]

# This test assumes icu and json to be available in the LOCAL_EXTENSION_REPO and NOT linked into duckdb statically
# -> this should be the case for our autoloading tests where we have the local_extension_repo variable set
require-env LOCAL_EXTENSION_REPO

require json

require icu

# Ensure we have a clean extension directory without any preinstalled extensions
statement ok
set extension_directory='__TEST_DIR__/autoloading_types'

### No autoloading nor installing: throw error with installation hint
statement ok
set autoload_known_extensions=false

statement ok
set autoinstall_known_extensions=false

statement maybe
SELECT '{}'::JSON;
----
Catalog Error: Type with name "JSON" is not in the catalog, but it exists in the json extension.

### With autoloading, install and correct repo
statement ok
set autoload_known_extensions=true

statement ok
set autoinstall_known_extensions=true

statement ok
set autoinstall_extension_repository='${LOCAL_EXTENSION_REPO}';

query I
SELECT '{}'::JSON;
----
{}