34 | Sorry, the page you are looking for does not exist. 35 |
36 | 46 |48 | {label} 49 |
50 |{message}
29 |39 | {error.message || "An unexpected error occurred while rendering the application."} 40 |
41 | 48 |161 | {body} 162 |
163 | ) 164 | }) 165 | FormMessage.displayName = "FormMessage" 166 | 167 | export { 168 | useFormField, 169 | Form, 170 | FormItem, 171 | FormLabel, 172 | FormControl, 173 | FormDescription, 174 | FormMessage, 175 | FormField, 176 | } 177 | -------------------------------------------------------------------------------- /src/components/ui/alert-dialog.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" 3 | 4 | import { cn } from "@/lib/utils" 5 | import { buttonVariants } from "@/components/ui/button" 6 | 7 | const AlertDialog = AlertDialogPrimitive.Root 8 | 9 | const AlertDialogTrigger = AlertDialogPrimitive.Trigger 10 | 11 | const AlertDialogPortal = AlertDialogPrimitive.Portal 12 | 13 | const AlertDialogOverlay = React.forwardRef< 14 | React.ElementRef
51 | Duck-UI
52 | 59 | Connection 60 |
61 |69 | Navigate 70 |
71 | 78 | 86 |93 | Resources 94 |
95 | 107 | 119 |126 | Appearance 127 |
128 | 145 |24 | {error.message || "An error occurred while displaying the results."} 25 |
26 | 32 |88 | There's no data yet! Run a query to get started. 89 |
90 |
Duck-UI
2 |
3 | Duck-UI is a web-based interface for interacting with DuckDB, a high-performance analytical database system. This project leverages DuckDB's WebAssembly (WASM) capabilities to provide a seamless and efficient user experience directly in the browser.
4 |
5 | # [Official Docs](https://duckui.com?utm_source=github&utm_medium=readme) 🚀
6 | # [Demo](https://demo.duckui.com?utm_source=github&utm_medium=readme) 💻
7 |
8 |
9 | ## Features
10 |
11 | - **SQL Editor**: Write and execute SQL queries with syntax highlighting and auto-completion.
12 | - **Data Import**: Import data from CSV, JSON, Parquet, and Arrow files.
13 | - **Data Explorer**: Browse and manage databases and tables.
14 | - **Query History**: View and manage your recent SQL queries.
15 |
16 | ## Getting Started
17 |
18 |
19 | ### Docker (Recommended)
20 |
21 | ```bash
22 | docker run -p 5522:5522 ghcr.io/ibero-data/duck-ui:latest
23 | ```
24 |
25 | Open your browser and navigate to `http://localhost:5522`.
26 |
27 | ### Environment Variables
28 |
29 | You can customize Duck-UI behavior using environment variables:
30 |
31 | ```bash
32 | # For external DuckDB connections
33 | docker run -p 5522:5522 \
34 | -e DUCK_UI_EXTERNAL_CONNECTION_NAME="My DuckDB Server" \
35 | -e DUCK_UI_EXTERNAL_HOST="http://duckdb-server" \
36 | -e DUCK_UI_EXTERNAL_PORT="8000" \
37 | -e DUCK_UI_EXTERNAL_USER="username" \
38 | -e DUCK_UI_EXTERNAL_PASS="password" \
39 | -e DUCK_UI_EXTERNAL_DATABASE_NAME="my_database" \
40 | -e DUCK_UI_ALLOW_UNSIGNED_EXTENSIONS="true" \
41 | ghcr.io/ibero-data/duck-ui:latest
42 | ```
43 |
44 | | Variable | Description | Default |
45 | |----------|-------------|---------|
46 | | `DUCK_UI_EXTERNAL_CONNECTION_NAME` | Name for the external connection | "" |
47 | | `DUCK_UI_EXTERNAL_HOST` | Host URL for external DuckDB | "" |
48 | | `DUCK_UI_EXTERNAL_PORT` | Port for external DuckDB | null |
49 | | `DUCK_UI_EXTERNAL_USER` | Username for external connection | "" |
50 | | `DUCK_UI_EXTERNAL_PASS` | Password for external connection | "" |
51 | | `DUCK_UI_EXTERNAL_DATABASE_NAME` | Database name for external connection | "" |
52 | | `DUCK_UI_ALLOW_UNSIGNED_EXTENSIONS` | Allow unsigned extensions in DuckDB | false |
53 |
54 |
55 |
56 | ### Prerequisites
57 |
58 | - Node.js >= 20.x
59 | - npm >= 10.x
60 |
61 | ### Installation
62 |
63 | 1. Clone the repository:
64 |
65 | ```bash
66 | git clone https://github.com/ibero-data/duck-ui.git
67 | cd duck-ui
68 | ```
69 |
70 | 2. Install dependencies:
71 |
72 | ```bash
73 | npm install
74 | # or
75 | yarn install
76 | ```
77 |
78 | ### Running the Application
79 |
80 | 1. Start the development server:
81 |
82 | ```bash
83 | npm run dev
84 | # or
85 | yarn dev
86 | ```
87 |
88 | 2. Open your browser and navigate to `http://localhost:5173`.
89 |
90 | ### Building for Production
91 |
92 | To create a production build, run:
93 |
94 | ```bash
95 | npm run build
96 | # or
97 | yarn build
98 | ```
99 |
100 | The output will be in the `dist` directory.
101 |
102 | ### Running with Docker
103 |
104 | 1. Build the Docker image:
105 |
106 | ```bash
107 | docker build -t duck-ui .
108 | ```
109 |
110 | 2. Run the Docker container:
111 |
112 | ```bash
113 | docker run -p 5522:5522 duck-ui
114 | ```
115 |
116 | 3. Open your browser and navigate to `http://localhost:5522`.
117 |
118 | ## Usage
119 |
120 | ### SQL Editor
121 |
122 | - Write your SQL queries in the editor.
123 | - Use `Cmd/Ctrl + Enter` to execute the query.
124 | - View the results in the results pane.
125 |
126 | ### Data Import
127 |
128 | - Click on the "Import Files" button to upload CSV, JSON, Parquet, or Arrow files.
129 | - Configure the table name and import settings.
130 | - For CSV files, you can customize import options:
131 | - Header row detection
132 | - Auto-detection of column types
133 | - Delimiter specification
134 | - Error handling (ignore errors, null padding for missing columns)
135 | - View the imported data in the Data Explorer.
136 |
137 | ### Data Explorer
138 |
139 | - Browse through the databases and tables.
140 | - Preview table data and view table schemas.
141 | - Delete tables if needed.
142 |
143 | ### Query History
144 |
145 | - Access your recent queries from the Query History section.
146 | - Copy queries to the clipboard or re-execute them.
147 |
148 | ### Theme Toggle
149 |
150 | - Switch between light and dark themes using the theme toggle button.
151 |
152 | ### Keyboard Shortcuts
153 |
154 | - `Cmd/Ctrl + B`: Expand/Shrink Sidebar
155 | - `Cmd/Ctrl + K`: Open Search Bar
156 | - `Cmd/Ctrl + Enter`: Run Query
157 | - `Cmd/Ctrl + Shift + Enter`: Run highlighted query
158 |
159 | ## Contributing
160 |
161 | Contributions are welcome! Please follow these steps to contribute:
162 |
163 | 1. Fork the repository.
164 | 2. Create a new branch (`git checkout -b feature/your-feature`).
165 | 3. Commit your changes (`git commit -m 'Add some feature'`).
166 | 4. Push to the branch (`git push origin feature/your-feature`).
167 | 5. Open a pull request.
168 |
169 | ## License
170 |
171 | This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.
172 |
173 | ## Acknowledgements
174 |
175 | - [DuckDB](https://duckdb.org/)
176 | - [React](https://reactjs.org/)
177 | - [Tailwind CSS](https://tailwindcss.com/)
178 | - [Zustand](https://github.com/pmndrs/zustand)
179 | - [Lucide Icons](https://lucide.dev/)
180 |
181 | ## Contact
182 |
183 | For any inquiries or support, please contact [Caio Ricciuti](https://github.com/caioricciuti).
184 |
185 | ## Sponsors
186 |
187 | This project is sponsored by:
188 |
189 | ### [Ibero Data](https://iberodata.es/)
190 |
191 |
192 | ### [qxip](https://qxip.net/?utm_source=duck-ui&utm_medium=sponsorship)
193 |
194 |
195 |
196 |
197 |
198 | 58 | You are connected to an external server. The data explorer is 59 | disabled for external connections. The external connection is 60 | yet in alpha stage and will be improved in future updates. 61 |
62 |You can still work normally with the query editor.
63 |Loading databases...
77 |145 | No databases found. Start by importing some data! 146 |
147 |