Managing Local Files
This guide explains how to use Coginiti's Local Files feature to manage and work with your local file directory within the application. The Local Files feature enables you to open, edit, and save queries and data files in one centralized location, streamlining your data analysis workflow.
Overview
Coginiti's Local Files feature provides seamless integration between your local file system and the application, allowing you to:
- Access local directories directly from within Coginiti
- Open and edit SQL files in the integrated code editor
- View CSV and Parquet files in the result grid
- Query data files directly without importing
- Save query results to local files
- Manage file organization through the integrated file browser
Key Benefits
Unified Workflow: Work with local files without leaving Coginiti Direct File Access: No need to import files for analysis Real-time Synchronization: Reflect local file system changes instantly Multiple File Format Support: Handle SQL, CSV, Parquet, and other formats Integrated Editing: Edit SQL files with full IDE features
Setting Up Local File Access
Step 1: Locate the Files Tab
- Find the Files tab on the left side of the Coginiti interface
- The tab appears in the main navigation panel alongside other features
- Click the Files tab to access the local files interface
Step 2: Add Your Local File Directory
- Click "Open Folder" to add your local file directory
- A file browser dialog will appear allowing you to navigate your file system
- Select the folder you want to add and access from within Coginiti
- Click "Confirm" or "Select Folder" to add the directory
Step 3: Verify Directory Access
- Your selected folder will now appear in the Files tab
- Expand the folder structure to see subdirectories and files
- Browse through your files using the integrated file explorer
- Verify file types are properly recognized and displayed
Choose a directory that contains your frequently used SQL files, data files, and project folders for the most efficient workflow. You can add multiple directories if needed.
Working with Data Files
Opening CSV Files
CSV files can be opened directly in Coginiti's Result Grid for immediate viewing and analysis:
Step 1: Access CSV File
- Navigate to your CSV file in the Files tab
- Double-click on the CSV file to open it
- The file opens automatically in the Result Grid
Step 2: View and Analyze Data
- Data displays in a tabular format in the Result Grid
- Column headers are automatically detected and displayed
- Scroll through data to explore the dataset
- View data types and column information
Step 3: Query CSV Data
- Write SQL queries against the CSV file directly
- Use the file name as the table reference in your queries
- Click "Reload Data" to execute queries against the file
- Make adjustments to your queries as needed
Example CSV Query:
SELECT
column1,
column2,
COUNT(*) as record_count
FROM your_file.csv
WHERE column1 IS NOT NULL
GROUP BY column1, column2
ORDER BY record_count DESC
Opening Parquet Files
Parquet files are handled similarly to CSV files with optimized performance for columnar data:
Step 1: Access Parquet File
- Navigate to your Parquet file in the Files tab
- Double-click on the Parquet file to open it
- The file loads in the Result Grid with column metadata
Step 2: Explore Parquet Data
- Column types are automatically detected from Parquet metadata
- Data compression is handled transparently
- Complex data types (arrays, structs) are displayed appropriately
- Schema information is available for reference
Step 3: Query Parquet Data
- Write queries using standard SQL syntax
- Leverage column pruning for efficient queries
- Use predicate pushdown for better performance
- Handle nested data structures with appropriate SQL functions
Example Parquet Query:
SELECT
customer_id,
order_date,
SUM(order_amount) as total_amount
FROM sales_data.parquet
WHERE order_date >= '2024-01-01'
GROUP BY customer_id, order_date
HAVING total_amount > 1000
Supported File Formats
Data Files
- CSV: Comma-separated values with customizable delimiters
- Parquet: Columnar storage format with schema preservation
- JSON: JavaScript Object Notation files (where supported)
- TSV: Tab-separated values files
- Excel: Spreadsheet files (XLSX, XLS) in supported versions
Query Files
- SQL: Standard SQL query files with syntax highlighting
- CoginitiScript: Coginiti-specific script files with macro support
- Text: Plain text files for documentation and notes
Working with SQL Files
Opening SQL Files in Code Editor
SQL files integrate seamlessly with Coginiti's code editor:
Step 1: Open SQL File
- Navigate to your SQL file in the Files tab
- Double-click on the SQL file to open it
- The file opens in the Code Editor with full IDE features
Step 2: Edit and Execute
- Syntax highlighting is automatically applied
- Code completion and IntelliSense features are available
- Execute queries directly from the editor
- Save changes back to the local file
Step 3: File Management
- Create new SQL files directly in the editor
- Save as different file names for version control
- Organize files in folders for project management
- Track file modifications with unsaved changes indicators
Code Editor Features
Advanced Editing
- Syntax highlighting for SQL and CoginitiScript
- Auto-completion for SQL keywords and functions
- Bracket matching and code folding
- Multi-cursor editing for bulk changes
- Find and replace with regex support
Query Execution
- Execute selected text or entire file
- View query results in integrated result grid
- Export results to various formats
- Query history and result caching
File Operations
- Auto-save functionality (if enabled)
- File change detection and reload prompts
- Version comparison and diff viewing
- Integration with version control systems
Data Analysis Workflows
Direct File Querying
Query data files without importing them into a database:
CSV Analysis Workflow
- Open CSV file in Result Grid
- Write exploratory queries to understand the data structure
- Apply filters and aggregations to analyze specific subsets
- Use statistical functions for data profiling
- Save transformed results to new files or tables
Parquet Processing Workflow
- Load Parquet file with automatic schema detection
- Leverage columnar efficiency for analytical queries
- Handle complex nested data with appropriate SQL functions
- Process large datasets with optimized query execution
- Export processed results in various formats
Save to Table Feature
Convert query results into persistent tables:
Step 1: Execute Query
- Run your query against the local file
- Review the results in the Result Grid
- Ensure data quality and expected output
Step 2: Save Results
- Click "Save to Table" in the Result Grid
- Choose destination database connection
- Specify table name and schema
- Configure data types and constraints as needed
Step 3: Table Configuration
- Select primary keys if applicable
- Set up indexes for performance optimization
- Configure table permissions and access controls
- Verify table creation and data loading
File Export and Import
Export Query Results
- CSV export: Comma-separated format for spreadsheet applications
- Excel export: Native Excel format with formatting preservation
- JSON export: Structured data format for API integration
- Parquet export: Efficient columnar format for big data workflows
Import from External Sources
- Database export: Import query results from database connections
- API data: Import data from REST API responses
- Cloud storage: Import files from object store connections
- Clipboard import: Paste data directly from clipboard
File Management and Organization
Refreshing Local Files
Keep your file view synchronized with local file system changes:
Manual Refresh
- Click the refresh button (🔄) in the Files tab
- All folders and files are rescanned for changes
- New files appear immediately in the file browser
- Deleted files are removed from the view
- Modified files show updated timestamps
Automatic Refresh
- File system monitoring detects changes in real-time (where supported)
- Auto-refresh intervals can be configured in settings
- Change notifications alert you to external modifications
- Conflict resolution for files modified both locally and in Coginiti
File Organization Best Practices
Directory Structure
Projects/
├── project-alpha/
│ ├── queries/
│ │ ├── analysis.sql
│ │ └── reports.sql
│ ├── data/
│ │ ├── source.csv
│ │ └── processed.parquet
│ └── results/
│ └── output.xlsx
├── project-beta/
│ ├── scripts/
│ └── datasets/
└── shared/
├── common-queries/
└── reference-data/
Naming Conventions
- Use descriptive names:
customer_analysis_2024.sqlinstead ofquery1.sql - Include dates:
sales_report_2024_01.csvfor time-based data - Version control:
analysis_v1.sql,analysis_v2.sqlfor iterations - Consistent formatting: Use underscores or hyphens consistently
File Type Organization
- Separate query files from data files for clarity
- Group related files in project-specific directories
- Maintain result archives in dedicated output folders
- Use staging areas for temporary or work-in-progress files
Advanced Features
Multi-Directory Support
Add and manage multiple local directories:
Adding Multiple Directories
- Click "Open Folder" multiple times to add additional directories
- Each directory appears as a separate root in the Files tab
- Switch between directories by expanding/collapsing them
- Organize by purpose: projects, data sources, archives
Directory Management
- Remove directories that are no longer needed
- Rename directory labels for better organization
- Set directory priorities for default access
- Configure directory-specific settings
Integration with Database Connections
Combine local files with database queries:
File-to-Database Workflows
- Analyze local files to understand data structure
- Create database tables based on file schemas
- Import file data into database tables
- Join file data with existing database tables
- Export combined results back to local files
Database-to-File Workflows
- Execute database queries to extract data
- Export results to local files for offline analysis
- Share results through local file system
- Archive historical data in local file formats
- Backup critical datasets to local storage
Collaboration Features
Share and collaborate using local files:
Version Control Integration
- Git integration for SQL file version control
- Change tracking for collaborative development
- Merge conflict resolution for concurrent edits
- Branch management for feature development
File Sharing
- Network drive support for team file sharing
- Cloud storage synchronization with services like Dropbox, Google Drive
- Export sharing through standardized file formats
- Documentation generation from query comments and metadata
Troubleshooting
Common Issues
Files Not Appearing
Symptoms: Selected directory doesn't show files or shows empty
Solutions:
- Check directory permissions: Ensure Coginiti has read access to the directory
- Verify directory path: Confirm the selected directory exists and is accessible
- Refresh the view: Click the refresh button to rescan the directory
- Check file filters: Ensure file type filters aren't hiding your files
Cannot Open Files
Symptoms: Double-clicking files doesn't open them
Solutions:
- Verify file format support: Ensure the file type is supported by Coginiti
- Check file permissions: Confirm the file isn't locked or read-only
- Validate file integrity: Ensure the file isn't corrupted
- Restart application: Close and reopen Coginiti to reset file handlers
Query Execution Errors
Symptoms: Cannot query CSV or Parquet files
Solutions:
- Check file format: Ensure CSV has proper headers and delimiter formatting
- Validate data types: Verify data types are compatible with SQL operations
- Review file size: Large files may require different handling approaches
- Check file encoding: Ensure files use UTF-8 or compatible encoding
Performance Optimization
Large File Handling
- Use Parquet format for large datasets to improve query performance
- Implement file chunking for processing very large CSV files
- Consider database import for frequently queried large files
- Use column selection to reduce memory usage
Query Optimization
- Add WHERE clauses to filter data early in processing
- Use appropriate indexes when saving to database tables
- Leverage column pruning in Parquet files
- Implement query result caching for repeated operations
Security Considerations
File Access Security
Local File Permissions
- Set appropriate file permissions on directories containing sensitive data
- Use operating system access controls to restrict directory access
- Implement file encryption for sensitive data files
- Monitor file access through system audit logs
Data Protection
- Avoid storing credentials in plain text SQL files
- Use parameterized queries instead of hardcoded sensitive values
- Implement data masking for development and testing files
- Regular security audits of file access patterns
Compliance Considerations
Data Governance
- Document data sources and file lineage
- Implement retention policies for temporary and working files
- Track data modifications and version history
- Maintain audit trails for compliance reporting
Privacy Protection
- Handle PII data according to privacy regulations
- Implement data anonymization for shared files
- Use secure file deletion for sensitive data removal
- Regular compliance reviews of file handling practices
Best Practices
File Management
Organization
- Use consistent naming conventions across all projects
- Maintain clean directory structures with logical hierarchies
- Regular file cleanup to remove obsolete files
- Document file purposes and data sources
Version Control
- Use version numbers or dates in file names
- Maintain change logs for important query files
- Backup critical files regularly
- Test restored files to ensure integrity
Workflow Efficiency
Query Development
- Start with small data samples for query development
- Use comments to document complex query logic
- Modularize queries into reusable components
- Test queries thoroughly before production use
Data Processing
- Validate data quality before analysis
- Document data transformations and business logic
- Use staging files for intermediate processing steps
- Implement error handling for data processing workflows
Summary
You have successfully configured Local Files management in Coginiti! Key achievements:
✅ Directory Integration: Seamless access to local file directories within Coginiti ✅ Multi-Format Support: Direct querying of CSV, Parquet, and other data files ✅ SQL File Management: Integrated editing and execution of SQL query files ✅ Data Analysis Workflows: Efficient file-to-database and database-to-file processes ✅ File Organization: Best practices for directory structure and file management ✅ Performance Optimization: Techniques for handling large files and complex queries
Your Coginiti instance now provides comprehensive local file integration, enabling efficient data analysis workflows that bridge local file systems with cloud databases and object storage.