Create Database
Learn how to create and configure databases in CodeNull
Creating a Database
CodeNull makes it easy to create and configure databases for your web application without writing complex setup code. This guide walks you through the process of creating different types of databases within the platform.
Database Creation Process
Access the Database Dashboard
From your project dashboard, navigate to the Database section in the main navigation panel.
Create a New Database
Click the “Create Database” button in the top-right corner of the Database Dashboard.
Select Database Type
Choose the type of database that best suits your application needs:
- MongoDB: Flexible document database (recommended for most projects)
- PostgreSQL: Advanced relational database
- MySQL: Popular SQL database
- Import from Excel/CSV: Create a database from existing spreadsheet data
Configure Settings
Enter basic configuration for your database:
- Database Name: A unique identifier for your database
- Description: Optional information about the database purpose
- Environment: Development, Staging, or Production
- Advanced Settings: Performance and security options
Database Connection Settings
Each database type has specific connection settings that you can configure:
Configuration Options:
- Connection method (Direct Connect or Connection String)
- Authentication method
- Network access rules
- Maximum connections
- Timeout settings
Configuration Options:
- Connection method (Direct Connect or Connection String)
- Authentication method
- Network access rules
- Maximum connections
- Timeout settings
Configuration Options:
- Host information
- Port settings
- SSL configuration
- Connection pooling
- Schema preferences
Configuration Options:
- Server connection details
- Authentication credentials
- Character set and collation
- Buffer settings
- Query timeout values
Creating a MongoDB Database
MongoDB is the recommended database type for most CodeNull projects. Here’s how to create one:
Select MongoDB
From the database type options, select “MongoDB”.
Basic Settings
Enter:
- Database Name: (e.g., “my-project-db”)
- Description: “Main database for my project”
- Environment: Development (for initial setup)
Connection Settings
Choose from:
- Managed Database: CodeNull creates and manages the database (recommended)
- External Connection: Connect to an existing MongoDB instance
For managed databases, you only need to select your preferred region.
Security Settings
Configure:
- Authentication Method: Username/Password or Certificate
- IP Access Rules: Restrict access to specific IP addresses
- Encryption Settings: Enable/disable encryption at rest
Finalize Creation
Click “Create Database” to provision your MongoDB instance.
When creating a managed MongoDB database, CodeNull automatically configures optimal settings based on your project size and expected usage patterns.
Importing from Excel/CSV
To create a database from existing spreadsheet data:
Select Import Option
Choose “Import from Excel/CSV” as your database type.
Upload File
Drag and drop your Excel file or CSV into the upload area.
Configure Import
Map your spreadsheet:
- Header Row: Identify column headers
- Data Types: Confirm or change detected data types
- Collection/Table Name: Name for the imported data
- Primary Key: Select a column as unique identifier
Review Schema
Review the detected schema and make any necessary adjustments.
Complete Import
Click “Create Database from Import” to finalize.
Best Practices
Start with a MongoDB database for most projects, as its flexible schema allows for easier changes as your application evolves.
- Choose descriptive names: Use clear, standardized naming for your databases
- Create separate development environments: Keep development and production databases separate
- Document your database purpose: Add detailed descriptions to help team members
- Consider future scaling: Select options that allow for growth
- Secure from the start: Configure proper authentication and access controls early
Next Steps
After creating your database, you can: