Write a Python program that uses the CherryPy web framework to create a simple REST API with endpoints for creating, reading, updating, and deleting records in a SQLite database.
First, you need to install CherryPy and SQLite3 using pip:

```bash
pip install cherrypy
```

Now let's create a simple REST API with CherryPy and SQLite3.

```python
import os
import sqlite3
import json

import cherrypy

DB_NAME = "my_database.db"


def setup_database():
    conn = sqlite3.connect(DB_NAME)
    c = conn.cursor()
    c.execute("CREATE TABLE IF NOT EXISTS records (id INTEGER PRIMARY KEY AUTOINCREMENT, data TEXT)")
    conn.commit()
    conn.close()


class MyAPI:
    @cherrypy.expose
    @cherrypy.tools.json_out()
    def index(self):
        return {"message": "Welcome to the REST API"}

    @cherrypy.expose
    @cherrypy.tools.json_out()
    def create(self, data):
        conn = sqlite3.connect(DB_NAME)
        c = conn.cursor()
        c.execute("INSERT INTO records (data) VALUES (?)", (data,))
        conn.commit()
        record_id = c.lastrowid
        conn.close()
        return {"record_id": record_id}

    @cherrypy.expose
    @cherrypy.tools.json_out()
    def read(self, record_id=None):
        conn = sqlite3.connect(DB_NAME)
        c = conn.cursor()

        if record_id is None:
            c.execute("SELECT * FROM records")
            result = [{"id": row[0], "data": row[1]} for row in c.fetchall()]
        else:
            c.execute("SELECT * FROM records WHERE id=?", (record_id,))
            row = c.fetchone()
            if row is None:
                result = {"error": "Record not found"}
            else:
                result = {"id": row[0], "data": row[1]}

        conn.close()
        return result

    @cherrypy.expose
    @cherrypy.tools.json_out()
    def update(self, record_id, data):
        conn = sqlite3.connect(DB_NAME)
        c = conn.cursor()

        c.execute("UPDATE records SET data=? WHERE id=?", (data, record_id))
        if c.rowcount == 0:
            result = {"error": "Record not found"}
        else:
            result = {"record_id": record_id}

        conn.commit()
        conn.close()
        return result

    @cherrypy.expose
    @cherrypy.tools.json_out()
    def delete(self, record_id):
        conn = sqlite3.connect(DB_NAME)
        c = conn.cursor()

        c.execute("DELETE FROM records WHERE id=?", (record_id,))
        if c.rowcount == 0:
            result = {"error": "Record not found"}
        else:
            result = {"deleted_record_id": record_id}

        conn.commit()
        conn.close()
        return result


if __name__ == "__main__":
    setup_database()
    cherrypy.quickstart(MyAPI(), "/", config=None)
```

This code creates a simple REST API with CherryPy and SQLite3. The endpoints are:

- `/`: Welcome message
- `/create?data=your_data_here`: Create a new record with the given data
- `/read`: Read all records
- `/read?record_id=id_here`: Read a specific record by ID
- `/update?record_id=id_here&data=new_data_here`: Update a record's data by ID
- `/delete?record_id=id_here`: Delete a record by ID