Import database file .sql

Hello friends ,

i have a .sql file of database, but i want to use in offline app, so how to i use this file in offline app.

please help me friends .

Hello, export your file to a text block in CSV or JSON format.

but i have a .sql file

You can convert it to the desired format.

http://www.convertcsv.com/sql-to-csv.htm

If you do not want to convert it, then an algorithm is created for parsing data from this format with help of loop, text and list blocks.

after convert sql to csv then how to i import in app ??

Copy the result data into a text block.

if i would like to import sql file then which extension i need to import ??

Thunkable X does not have the ability to work with extensions

but thunkable classic is sported

Thunkable Classic and Thunkable X are different development tools that have different functionality.

i have a sqliteAddons extension but in this i not to show import block, so have you any idea how to i import file of sql

Do you mean by a .sql file a file with such data?

/**
 * Continents 
 */
SET FOREIGN_KEY_CHECKS=0;
 
-- ----------------------------
-- Table structure for `continents`
-- ----------------------------
DROP TABLE IF EXISTS `continents`;
CREATE TABLE `continents` (
  `code` char(2) NOT NULL COMMENT 'Continent code',
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
 
-- ----------------------------
-- Records of continents
-- ----------------------------
INSERT INTO `continents` VALUES ('AF', 'Africa');
INSERT INTO `continents` VALUES ('AN', 'Antarctica');
INSERT INTO `continents` VALUES ('AS', 'Asia');
INSERT INTO `continents` VALUES ('EU', 'Europe');
INSERT INTO `continents` VALUES ('NA', 'North America');
INSERT INTO `continents` VALUES ('OC', 'Oceania');
INSERT INTO `continents` VALUES ('SA', 'South America');
INSERT INTO `continents` VALUES ('??', NULL);
1 Like

yes, i have 600 record in table.

This data i want to show in my app, like

whene screen initialize then diaplay first record, when user click on next button then display second record, when user click on previous then display previous record as well as …

So how to do i ??

please help me

  1. the Entire text of the file copy in a text box
  2. Then in the loop you need to obtain the desired entries in the list
  3. the list to display in List Viewer and make event processing when you select a list item

If you do not understand this algorithm, during the day I’ll try to make a simple example.

please give me one example

Thank you so much.

Check it.

  1. https://csvjson.com/sql2json I converted .sql to json
  2. Сopy the result in the data and remove unwanted data from JSON (you can leave them, but then the algorithm will be more difficult)
  3. Created from JSON data list and made handler for selecting list item

https://x.thunkable.com/projects/5b53152859e51a188b6b060d/project/properties/designer/

so tell me inthis screen shot, i will which data put to in the block ?/ please help me

Put all data json and then removed unnecessary symbols.

All source JSON

{
  "continents": [
    {
      "code": "AF",
      "name": "Africa"
    },
    {
      "code": "AN",
      "name": "Antarctica"
    },
    {
      "code": "AS",
      "name": "Asia"
    },
    {
      "code": "EU",
      "name": "Europe"
    },
    {
      "code": "NA",
      "name": "North America"
    },
    {
      "code": "OC",
      "name": "Oceania"
    },
    {
      "code": "SA",
      "name": "South America"
    },
    {
      "code": "??",
      "name": null
    }
  ]
}

JSON in the block

    {
      "code": "AF",
      "name": "Africa"
    },
    {
      "code": "AN",
      "name": "Antarctica"
    },
    {
      "code": "AS",
      "name": "Asia"
    },
    {
      "code": "EU",
      "name": "Europe"
    },
    {
      "code": "NA",
      "name": "North America"
    },
    {
      "code": "OC",
      "name": "Oceania"
    },
    {
      "code": "SA",
      "name": "South America"
    },
    {
      "code": "??",
      "name": null
    }

in this how to i set next and previous button

so user see one by one text

To do this, output the data not in the List Viewer, but in the Label. Add buttons to navigate through the list entries list.