Tables


Create New Table

STEP 1, 2:

Go to Tables menu, Press Create New Table Button

image

STEP 3, 4:

Enter the number of columns/fields and press enter

image

STEP 5 to 15:

5: Enter name of the table, 6: Select the model for regular table and authenticatable for auth table, 7: select the primary key 'id' data type options are tinyIncrements, smallIncrements, mediumIncrements, Increments, bigIncrements. On hover on these options you will get the range values for different options. 8: Select the timestamps which will create 2 fields created_at and updated_at. 9: Enter field names this column. 10: Select the data type. 11: Enter the length of string or options seperated by comma for enum data type or M(total digits), D(decimals) for decimal data type. 12: Enter the default value, if no value entered then default will be null. 13: Select the index value, options available are Primary, Unique, Index. 14: Press Create New Table button. Troubleshooting: the form has validation any mistake in the input will get back validation error message guiding you to correct mistake. After the table is created control takes you to listing screen where you see the table being created is listed out there. Additional Information: addition or deletion of fields at this stage is not possible. You can add or delete columns in the listing screen. This was to make validation more strong.

image

Add Field

STEP 1, 2:

Go to Tables menu, click on Add Fields link

image

STEP 3, 4:

Enter the number of columns/fields and press enter

image

STEP 5 to 11:

For steps from 5 to 9 refer section Create New Table Steps 9 to 13. 10: Select existing field name after which this column should appear. 11: Press Update Table button.

image

Rename Field

STEP 1, 2: remains common for next table actions.

STEP 3 to 5:

3: Select the existing column name. 4: Enter new column name. 5: Press rename button.

image

Delete Field

Steps for Delete Field, Add Index, Remove Index, Rename Table, Truncate Table, Delete Table will be similar to Rename Field


Add Index

Steps for Delete Field, Add Index, Remove Index, Rename Table, Truncate Table, Delete Table will be similar to Rename Field


Remove Index

Steps for Delete Field, Add Index, Remove Index, Rename Table, Truncate Table, Delete Table will be similar to Rename Field


CRUD (Crate Read Update Delete)

The typical crud view looks like below. Add New Record button and Edit link will take you to new screen. The heading row has input field to take search values

image

Rename Table

Steps for Delete Field, Add Index, Remove Index, Rename Table, Truncate Table, Delete Table will be similar to Rename Field


Truncate Table

Steps for Delete Field, Add Index, Remove Index, Rename Table, Truncate Table, Delete Table will be similar to Rename Field


Delete Table

Steps for Delete Field, Add Index, Remove Index, Rename Table, Truncate Table, Delete Table will be similar to Rename Field


Export Table

Clicking on the export table CSV or JSON link will download the CSV or JSON file as choosen containing whole table data.


Import - Create

Click CSV or JSON link under Import - Create to choose file and upload data in mass to table. Ensure that first row in the csv has keys required for table and subsequent rows the values. Also ensure the data types are correct.


Import - Update

Click CSV or JSON link under Import - Update to choose file and upload data to be updated in mass to table. Ensure that first row in the csv has keys required for table and subsequent rows the values. And there should be column with name id to update record for. Also ensure the data types are correct.


Api Calls

All your api calls should start with base_url: https://honeyweb.org/api/{your_app_id}/{auth_provider}

Also use header 'Content-Type': 'application/x-www-form-urlencoded'


Create A New Record In The Table

Url: https://honeyweb.org/api/{your_app_id}/{auth_provider}/{table_name}/new.

Post Body: {"_token":"session_token", your table keys and values follows}

Response on success: {"_token":"session_token", "status":"success"}

Response on validation fails: {object with validation errors}


GET All Records In The Table

Url: https://honeyweb.org/api/{your_app_id}/{auth_provider}/{table_name}/all?_token={session token}.

Response: {"status":"success", "data":[your data in the form of json array], "_token":"A Hash session token"}


GET Single Record In The Table

Url: https://honeyweb.org/api/{your_app_id}/{auth_provider}/{table_name}/{id}?_token={session token}.

Response: {"status":"success", "_token":"A Hash session token", "data":{your single record json object}}


Update an Existing Record

Url: https://honeyweb.org/api/{your_app_id}/{auth_provider}/{table_name}/{id}.

Post Body: {"_token":"session_token", your table keys and values follows}

Response on success: {"_token":"session_token", "status":"success"}

Response on validation fails: {object with validation errors}


Delete an Existing Record

Url: https://honeyweb.org/api/{your_app_id}/{auth_provider}/{table_name}/{id}.

Response on success: {"_token":"session_token", "status":"success"}