Manual Database Setup
A detailed walkthrough of creating tables, choosing data types, and setting up relationships.
Manual Database Setup: The Schema Builder
The NoCodeBackend Schema Builder gives you granular, point-and-click control over your database structure. It is the perfect tool for developers and architects who already have a clear Entity-Relationship Diagram (ERD) or know exactly what tables and data types their application needs.
This guide explores the complete process of building your schema manually, configuring column types, and optimizing your data model.
1. Detailed Overview
Unlike AI setup which abstracts the database creation, Manual Setup gives you direct access to enterprise data definition capabilities through a visual interface.
When you build a table manually, NoCodeBackend translates your UI actions into strict, highly optimized database structures.
Why Use Manual Setup?
- Precision: You control exact data types (e.g., distinguishing between
INTandBIGINT, orVARCHARandTEXT). - Data Integrity: You can enforce strict constraints at the database level (
NOT NULL, Default values, specific character lengths), preventing bad data from ever entering your system. - Iterative Design: You can start with a basic schema and seamlessly add columns as your application scales.
2. Step-by-Step Guide: Building a Data Schema
Let's build a typical E-Commerce schema with customers, products, and orders.
Step 2.1: Creating the Base Tables
- Navigate to Manage Tables in your database dashboard.
- Click Add Table.
- Name the table
customers(always use plural, lowercase snake_case). - Click Add Column and define:
email(Type:VARCHAR, Length:255, Required:true)password(Type:PASSWORD, Required:true)
- Save the table.
- Create another table named
products. - Add columns:
name(Type:VARCHAR, Length:255, Required:true)price(Type:DECIMAL, Precision:10, Scale:2, Required:true)stock_count(Type:INT, Required:true, Default Value:0)
- Save the
productstable.
Step 2.2: Creating the Order Data Structure
Now we need a table to store the orders customers place.
- Click Add Table and name it
orders. - Add the base columns:
customer_id(Type:INT, Required:true)product_id(Type:INT, Required:true)total_amount(Type:DECIMAL, Precision:10, Scale:2, Required:true)status(Type:DROPDOWN, Options:pending, shipped, delivered, Required:true, Default:pending)
- Save the table.
(Note: While the Schema Builder creates the structural columns, rigorous referential foreign-keys are automatically mapped if you use the AI Setup wizard, or you can manage data linkage purely through your API payload logic).
3. Configuration & Parameters
Every column in the schema builder has specific configuration properties mapped natively to enterprise data standards.
Data Types Breakdown
- INT: Whole numbers up to ~2.1 billion. Ideal for standard relational IDs, counters, and quantities.
- BIGINT: Massive whole numbers. Use this if your IDs or counters will exceed 2 billion.
- VARCHAR: Standard string storage where you define a maximum length (e.g., 255). Highly optimized for searching.
- TEXT: Large string storage for long-form content, articles, or massive descriptions.
- DECIMAL: Exact precision numbers. Crucial for financial applications (e.g.,
price,currency). You definePrecision(total digits) andScale(digits after the decimal). - FLOAT / DOUBLE: Floating-point numbers. Use for scientific calculations where exact precision is not strictly required.
- BOOLEAN: Native
true(1) orfalse(0) toggles. - DATE / DATETIME / TIMESTAMP: For storing dates and times.
- JSON: Stores raw JSON objects or arrays. Perfect for unstructured data or variable configuration settings that don't need their own tables.
- DROPDOWN: Maps to standard Enum types. You can specify the exact string options allowed (e.g.,
active,archived). - PASSWORD: A secure pseudo-type that maps to hashed storage, ensuring sensitive credentials are never stored in plaintext.
Column Constraints
- Required (NOT NULL): The database will reject any
POSTorPUTrequest that leaves this field empty. - Default Value: If the client omits this field in a
POSTrequest, the database will automatically insert this fallback value.
4. Best Practices & Edge Cases
- The
idColumn: Do not manually create anidcolumn. NoCodeBackend automatically injects a Primary Key into every table you make. - Use Decimal for Money: Never use
FLOATfor currency, as floating-point math can lead to precision errors (e.g.,$1.99 + $2.01 = $4.00000000001). Always useDECIMAL(10,2). - Handling Arrays: If a user can have multiple "tags", do not create a comma-separated string column. Either use a
JSONcolumn to store an array["tag1", "tag2"], or create a separateuser_tagstable for strict normalization. - Naming Conventions: Always use
snake_casefor columns (e.g.,first_name, notfirstName). This guarantees consistent behavior across the REST API and webhook payloads.
5. Troubleshooting
Common Errors
Error: Column limit reached
- Cause: Your current billing plan limits the number of tables or columns you can create in a single database.
- Resolution: Upgrade your workspace plan or remove unnecessary tables.
Error: Table already exists
- Cause: You are trying to create a table with a name that is reserved by NoCodeBackend's internal system.
- Resolution: Choose a different, application-specific name for your table.
