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

1

Access the Database Dashboard

From your project dashboard, navigate to the Database section in the main navigation panel.

2

Create a New Database

Click the “Create Database” button in the top-right corner of the Database Dashboard.

3

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
4

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

Creating a MongoDB Database

MongoDB is the recommended database type for most CodeNull projects. Here’s how to create one:

1

Select MongoDB

From the database type options, select “MongoDB”.

2

Basic Settings

Enter:

  • Database Name: (e.g., “my-project-db”)
  • Description: “Main database for my project”
  • Environment: Development (for initial setup)
3

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.

4

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
5

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:

1

Select Import Option

Choose “Import from Excel/CSV” as your database type.

2

Upload File

Drag and drop your Excel file or CSV into the upload area.

3

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
4

Review Schema

Review the detected schema and make any necessary adjustments.

5

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: