{"meta":{"title":"dataset import","intro":"[Plumbing] Import a set of TRAP files to a raw dataset.","product":"Security and code quality","breadcrumbs":[{"href":"/en/code-security","title":"Security and code quality"},{"href":"/en/code-security/reference","title":"Reference"},{"href":"/en/code-security/reference/code-scanning","title":"Code scanning"},{"href":"/en/code-security/reference/code-scanning/codeql","title":"CodeQL"},{"href":"/en/code-security/reference/code-scanning/codeql/codeql-cli-manual","title":"CodeQL CLI manual"},{"href":"/en/code-security/reference/code-scanning/codeql/codeql-cli-manual/dataset-import","title":"dataset import"}],"documentType":"article"},"body":"# dataset import\n\n[Plumbing] Import a set of TRAP files to a raw dataset.\n\n> [!NOTE]\n> This content describes the most recent release of the CodeQL CLI. For more information about this release, see https://github.com/github/codeql-cli-binaries/releases.\n>\n> To see details of the options available for this command in an earlier release, run the command with the <span style=\"white-space: nowrap;\">`--help`</span> option in your terminal.\n\n## Synopsis\n\n```shell copy\ncodeql dataset import --dbscheme=<file> [--threads=<num>] <options>... -- <dataset> <trap>...\n```\n\n## Description\n\n\\[Plumbing] Import a set of TRAP files to a raw dataset.\n\nCreate a dataset by populating it with TRAP files, or add data from TRAP\nfiles to an existing dataset. Updating a dataset is only possible if it\nhas the correct dbscheme _and_ its ID pool has been preserved from the\ninitial import.\n\n## Options\n\n### Primary Options\n\n#### `<dataset>`\n\n\\[Mandatory] Path to the raw QL dataset to create or update. The\ndirectory will be created if it doesn't already exist.\n\n#### `<trap>...`\n\nPaths to .trap(.gz) files to import, or to directories that will be\nrecursively scanned for .trap(.gz) files. If no files are given, an\nempty dataset will be created.\n\n#### `-S, --dbscheme=<file>`\n\n\\[Mandatory] The dbscheme definition that describes the TRAP files you\nwant to import.\n\n#### `-j, --threads=<num>`\n\nUse this many threads for the import operation.\n\nDefaults to 1. You can pass 0 to use one thread per core on the machine,\nor -_N_ to leave _N_ cores unused (except still use at least one\nthread).\n\n#### `--[no-]check-undefined-labels`\n\n\\[Advanced] Report errors for undefined labels.\n\n#### `--[no-]check-unused-labels`\n\n\\[Advanced] Report errors for unused labels.\n\n#### `--[no-]check-repeated-labels`\n\n\\[Advanced] Report errors for repeated labels.\n\n#### `--[no-]check-redefined-labels`\n\n\\[Advanced] Report errors for redefined labels.\n\n#### `--[no-]check-use-before-definition`\n\n\\[Advanced] Report errors for labels used before they're defined.\n\n#### `--[no-]fail-on-trap-errors`\n\n\\[Advanced] Exit non-zero if an error occurs during trap import.\n\n#### `--[no-]include-location-in-star`\n\n\\[Advanced] Construct entity IDs that encode the location in the TRAP\nfile they came from. Can be useful for debugging of TRAP generators, but\ntakes up a lot of space in the dataset.\n\n#### `--[no-]linkage-aware-import`\n\n\\[Advanced] Controls whether codeql dataset import is linkage-aware _(default)_ or not. On projects where this part of database creation\nconsumes too much memory, disabling this option may help them progress\nat the expense of database completeness.\n\nAvailable since `v2.15.3`.\n\n### Common options\n\n#### `-h, --help`\n\nShow this help text.\n\n#### `-J=<opt>`\n\n\\[Advanced] Give option to the JVM running the command.\n\n(Beware that options containing spaces will not be handled correctly.)\n\n#### `-v, --verbose`\n\nIncrementally increase the number of progress messages printed.\n\n#### `-q, --quiet`\n\nIncrementally decrease the number of progress messages printed.\n\n#### `--verbosity=<level>`\n\n\\[Advanced] Explicitly set the verbosity level to one of errors,\nwarnings, progress, progress+, progress++, progress+++. Overrides `-v`\nand `-q`.\n\n#### `--logdir=<dir>`\n\n\\[Advanced] Write detailed logs to one or more files in the given\ndirectory, with generated names that include timestamps and the name of\nthe running subcommand.\n\n(To write a log file with a name you have full control over, instead\ngive `--log-to-stderr` and redirect stderr as desired.)\n\n#### `--common-caches=<dir>`\n\n\\[Advanced] Controls the location of cached data on disk that will\npersist between several runs of the CLI, such as downloaded QL packs and\ncompiled query plans. If not set explicitly, this defaults to a\ndirectory named `.codeql` in the user's home directory; it will be\ncreated if it doesn't already exist.\n\nAvailable since `v2.15.2`."}