How to Configure DuckDB Create User
You cannot run a native duckdb create user command because the engine runs inside your app. Instead, you manage access through host system permissions, file locks, or cloud storage roles. Teams often share one database file on a server or cloud bucket for analytics. When file permissions are too broad, anyone on the host can change or delete tables. How the duckdb create user model works in practice Standard server databases check a username and password before a person runs a query. This loc
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You cannot run a native duckdb create user command because the engine runs inside your app. Instead, you manage access through host system permissions, file locks, or cloud storage roles. Teams often share one database file on a server or cloud bucket for analytics. When file permissions are too broad, anyone on the host can change or delete tables.
How the duckdb create user model works in practice
Standard server databases check a username and password before a person runs a query. This local engine works in a very different way. It runs as a library inside the host process on a computer or server. There is no background server listening for network logins from your team.
Because there is no login server, the database has no table of local users. The person running the process owns the whole database session from start to finish. If a person can read the database file on disk, they can read every table. If they have write rights on that file, they can drop or change any table.
To mimic a user setup, teams rely on operating system accounts and file groups. You create accounts on the Linux or Windows host and set strict file rules. Some teams put the database in a read-only mode when analysts open the file. That mode lets several people read data at once while blocking all write commands.
Setting up storage roles for remote files
Many teams do not keep their data inside one local database file on a disk. They use the engine to query data files that sit in cloud object storage. In this setup, your cloud provider handles the user accounts and access keys. You create roles in your cloud console and give each person a secret key.
The engine loads those cloud keys into memory for the length of the session. When an analyst runs a query, the engine sends the cloud key with the request. The storage bucket checks the key and decides if the person can read the file. This setup shifts user control from the database engine to your cloud storage system.
Still, managing secret keys on user laptops creates big risks for your data team. Analysts often save keys in plain text files on their work machines. If a laptop gets lost, those static keys stay active until someone deletes them. Teams also struggle to rotate those keys without breaking automated scripts and daily jobs.
User Provisioning (SCIM) + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Where host permissions and storage roles fall short
File rules and cloud roles only check who can open a file or bucket. They are all-or-nothing switches that work at the storage level. Once a person opens the file, the engine lets them read every row and column. You cannot hide one table or mask a single column using file rules alone.
Production datasets often hold emails, phone numbers, card numbers, and national IDs. An analyst might only need to sum up daily sales totals from a table. Yet file access gives that person the power to dump every customer email address. Even read-only mode cannot stop someone from pulling private fields onto their own machine.
Local file access also leaves your security team without a clear audit trail. Operating systems log when a user opens a file on a shared server. They do not record the actual SQL queries that the person ran inside the session. When a table changes or leaks, you cannot see which query caused the issue.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.
Before a query runs, hoop.dev guardrails check the statement against your rules, an AI Analyzer you configure can score intent or hold risky calls for human approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Does DuckDB have a built-in user and role system?
No, the core open-source engine does not include user accounts or role tables. It relies on host file permissions or external cloud storage roles to control access.
How can multiple people query the same database file at once?
You can open the database file in read-only mode across many sessions at once. If one process needs to write data, no other process can open the file then.
How do teams protect private columns in shared files?
Host file rules cannot filter out specific columns during a query. Teams either build clean data views in separate files or use runtime data masking rules.
Related guides
In this post