File tree Expand file tree Collapse file tree 2 files changed +9
-17
lines changed
datafusion/sql/src/unparser Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ pub struct SelectBuilder {
144144 /// This field uses `Option` to distinguish between three distinct states:
145145 /// - `None`: No projection has been set (not yet initialized)
146146 /// - `Some(vec![])`: Empty projection explicitly set (generates `SELECT FROM ...` or `SELECT 1 FROM ...`)
147+ /// - `Some(vec![SelectItem::Wildcard(...)])`: Wildcard projection (generates `SELECT * FROM ...`)
147148 /// - `Some(vec![...])`: Non-empty projection with specific columns/expressions
148149 ///
149150 /// Use `projection()` to set this field and `already_projected()` to check if it has been set.
Original file line number Diff line number Diff line change @@ -226,32 +226,23 @@ pub trait Dialect: Send + Sync {
226226 /// - Testing row existence without retrieving column data
227227 /// - Performance optimization when only row counts or existence checks are needed
228228 ///
229- /// # Supported Databases
230- ///
231- /// - **PostgreSQL**: Fully supported. Returns rows with zero columns.
232- ///
233- /// # Unsupported Databases
234- ///
235- /// Most other SQL databases require at least one column in the SELECT list:
236- /// - MySQL
237- /// - SQLite
238- /// - SQL Server
239- /// - Oracle
240- /// - DuckDB
229+ /// # Default
241230 ///
242- /// For these databases, the unparser falls back to `SELECT 1 FROM table`.
231+ /// Returns `false` for maximum compatibility across SQL dialects. When `false`,
232+ /// the unparser falls back to `SELECT 1 FROM table`.
243233 ///
244- /// # Default
234+ /// # Implementation Note
245235 ///
246- /// Returns `false` for maximum compatibility across SQL dialects.
236+ /// Specific dialects should override this method to return `true` if they support
237+ /// the empty select list syntax (e.g., PostgreSQL).
247238 ///
248239 /// # Example SQL Output
249240 ///
250241 /// ```sql
251- /// -- When supported (PostgreSQL/DataFusion) :
242+ /// -- When supported:
252243 /// SELECT FROM users WHERE active = true;
253244 ///
254- /// -- Fallback for other databases :
245+ /// -- Fallback when unsupported :
255246 /// SELECT 1 FROM users WHERE active = true;
256247 /// ```
257248 fn supports_empty_select_list ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments