# \[RESOLVED\] Make changes directly in

**URL:** <https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059>\
**Category:** Configuration\
**Created:** [August 27, 2024, 7:19pm UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059 "2024-08-27T19:19:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [August 27, 2024, 7:19pm UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/1 "2024-08-27T19:19:55Z")

</div>

Happy with my nice dashboards, I started running tests with my different devices, notably some fake MQTT devices.  
One in particular: a fake device that receives from Node-RED data about my daily electrical consumption.

But this device is supposed to receive data only once a day, which allows me to display a nice histogram.

Except that while testing, I sent data several times today… which broke my chart!! It looked great and now it doesn’t look like anything.

Is there a way to delete these «&nbsp;undesirable&nbsp;» entries from my DB? (especially since I didn’t know much about SQLite… and even less about DuckDB ^^ )

---

<div class="post-metadata">

**Author:** ![StephaneB](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/stephaneb/32/15443_2.png) [@StephaneB](https://community.gladysassistant.com/u/StephaneB)\
**Post date:** [August 27, 2024, 8:28pm UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/2 "2024-08-27T20:28:40Z")

</div>

I also need to make some adjustments in the database, to correct a solar production reading that failed three nights in a row, and everything piled up on the 4th night… So if there’s a tool to browse the DuckDB database and modify values, I’ll take it 😉

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [August 27, 2024, 9:27pm UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/3 "2024-08-27T21:27:55Z")

</div>

I haven’t tried it, but in the DuckDB docs it recommends a tool

> **[DBeaver SQL IDE](https://duckdb.org/docs/guides/sql_editors/dbeaver)**
>
> DBeaver is a powerful and popular desktop sql editor and integrated development environment (IDE). It has both an open source and enterprise version. It is useful for visually inspecting the available tables in DuckDB and for quickly building complex...

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 28, 2024, 7:04am UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/4 "2024-08-28T07:04:05Z")

</div>

Otherwise you can use [https://tableplus.com/](https://tableplus.com/) 🙂

- Pause your Gladys instance (`docker stop gladys`)
- Download the DuckDB database file to your machine (with a tool like Cyberduck or FileZilla it works very well)
- Open the file in TablePlus and delete the line that causes the problem
- Save and quit TablePlus
- Re-upload the file with Cyberduck/FileZilla
- Restart Gladys (`docker restart gladys`)

Be careful not to mess up the file ^^

---

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [August 28, 2024, 7:37am UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/5 "2024-08-28T07:37:38Z")

</div>

It’s simpler than I imagined 😉

Yes, we’ll avoid making a mess; anyway, when I do this I usually copy the file to have a backup just in case!

Thanks for your advice!

---

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [August 28, 2024, 7:42am UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/6 "2024-08-28T07:42:44Z")

</div>

However… I don’t know which type of database to choose in TablePlus 🤔

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/5/4/54c63cdc8c725e28270d8538f72a9309d4b7a15f.png)

---

<div class="post-metadata">

**Author:** ![Terdious](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/terdious/32/6316_2.png) [@Terdious](https://community.gladysassistant.com/u/Terdious)\
**Post date:** [August 28, 2024, 8:21am UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/7 "2024-08-28T08:21:47Z")

</div>

Normally you use SQLite from what I read on GitHub. But it didn’t work for me (empty table ^^).

---

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [August 28, 2024, 8:24am UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/8 "2024-08-28T08:24:26Z")

</div>

Same here… Nothing at all.

I tried DBeaver, but when I go look for the table `t_device_feature_state` since I imagine that’s the right one, the most recent values are from the day before yesterday… 🤔 How is that possible?

---

<div class="post-metadata">

**Author:** ![Terdious](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/terdious/32/6316_2.png) [@Terdious](https://community.gladysassistant.com/u/Terdious)\
**Post date:** [August 28, 2024, 8:35am UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/9 "2024-08-28T08:35:04Z")

</div>

Does that correspond to 48h «&nbsp;exactly&nbsp;»?

To confirm with @pierre-gilles, but the data on this timeline may be stored in memory then transferred to the file…

I’ll take a look!!

EDIT: No storage in «&nbsp;memory&nbsp;».

From what I see, unlike the SQL DB, when we stop gladys, duckdb’s .duckdb.wal remains and is more recent than the .duckdb … Can you confirm? What are the dates and times of the two files for you?  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/optimized/3X/6/9/6991297f9a961a5c8f41b966edfb5e809138dcf1_2_690x73.png)

For my part I only have 1 hour of inaccessible data (which corresponds to the time difference between the files - 9:52 vs 10:48):

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/9/0/9053c1857b9566237d27082bde3c49cb62cc92ce.jpeg)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 28, 2024, 10:48am UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/10 "2024-08-28T10:48:17Z")

</div>

Are you on Windows? I’m on macOS and I do have DuckDB in TablePlus, but apparently the other versions don’t have this DB yet. In your case, you should use DBeaver 🙂

Indeed, you must copy the two files (.duckdb + .duckdb.wal), and of course copy them **only if Gladys is stopped**.

---

<div class="post-metadata">

**Author:** ![Terdious](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/terdious/32/6316_2.png) [@Terdious](https://community.gladysassistant.com/u/Terdious)\
**Post date:** [August 28, 2024, 10:56am UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/11 "2024-08-28T10:56:48Z")

</div>

> [@pierre-gilles](#):
>
> Are you on Windows?

Yep for me! macOS often a step ahead ^^

> [@pierre-gilles](#):
>
> Indeed, you must copy the 2 files (.duckdb + .duckdb.wal), and of course copy them **only if Gladys is stopped**.

That’s the case, but when Gladys is stopped (via `docker stop gladys`) as mentioned above, the .wal is still present (unlike the SQL db) and there is 1 hour of «&nbsp;missing&nbsp;» data (clearly present on the graphs) in Gladys.

---

<div class="post-metadata">

**Author:** ![jean\_bruder](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/jean_bruder/32/13_2.png) [@jean\_bruder](https://community.gladysassistant.com/u/jean_bruder)\
**Post date:** [August 28, 2024, 11:31am UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/12 "2024-08-28T11:31:49Z")

</div>

Hello @_Will_71 ,

I’ve been using DBeaver professionally (DB2, MS SQL, MuSQL, PgSQL …) and personally (SQLite) for quite a while now, and it’s a great tool. Because data access is done visually, in table form (spreadsheet-style), you can easily edit the data 🙂  
Have a nice day,  
Jean

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [August 28, 2024, 2:55pm UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/13 "2024-08-28T14:55:20Z")

</div>

I usually use TablePlus but on Linux it’s not yet possible to open a DuckDB database.  
I’ll therefore try this tool.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 28, 2024, 5:17pm UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/14 "2024-08-28T17:17:26Z")

</div>

> [@Terdious](#):
>
> as mentioned above, the .wal is still present (unlike the SQL database)

Yes, and if you copy both files correctly and open the file in DBeaver, you should have all the data, right?

---

<div class="post-metadata">

**Author:** ![Terdious](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/terdious/32/6316_2.png) [@Terdious](https://community.gladysassistant.com/u/Terdious)\
**Post date:** [August 28, 2024, 6:02pm UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/15 "2024-08-28T18:02:16Z")

</div>

😅 no ^^ well — still -1h. And when I disconnect from the DB in DBeaver, this time the .wal is deleted!^^

---

<div class="post-metadata">

**Author:** ![Einstein8854](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/einstein8854/32/9474_2.png) [@Einstein8854](https://community.gladysassistant.com/u/Einstein8854)\
**Post date:** [August 28, 2024, 6:10pm UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/16 "2024-08-28T18:10:43Z")

</div>

I tried DBeaver Community, but a small problem: on my Gladys server running Linux DBeaver sees the database but returns an «&nbsp;access denied&nbsp;».  
A DBeaver Community on a Windows PC sees the local databases but not the network-accessible databases

---

<div class="post-metadata">

**Author:** ![Terdious](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/terdious/32/6316_2.png) [@Terdious](https://community.gladysassistant.com/u/Terdious)\
**Post date:** [August 28, 2024, 9:11pm UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/17 "2024-08-28T21:11:44Z")

</div>

@Einstein8854 did you duplicate it properly or at least stop Gladys before accessing it? It’s a single connection. You can’t access it at the same time as Gladys is running.

---

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [August 29, 2024, 7:46am UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/18 "2024-08-29T07:46:51Z")

</div>

Well, clearly things are never simple 😜

I retrieved my file, I found records that interested me, and I deleted them in DBeaver.

But when I tried to re-transfer my database to my server… FileZilla wouldn’t cooperate and refused to write to the directory.  
So I had to temporarily change the permissions of the `gladysassistant` folder to be able to copy my modified file there.

It’s done… and everything’s working!!!

Thanks again everyone for your help 🙂

BEFORE :

 ![Capture d’écran du 2024-08-28 09-38-42](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/d/5/d516172874a2aaf271edddae6a3b9e58c61ab7f8.png)

AFTER :

 ![Capture d’écran du 2024-08-29 09-44-01](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/9/f/9fe56e107d77131ba75c39528ced0785724f4919.png)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [August 29, 2024, 8:22am UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/19 "2024-08-29T08:22:45Z")

</div>

> [@Terdious](#):
>
> 😅 no ^^ well — still -1h. And when I disconnect the DB in DBeaver, this time the .wal is deleted! ^^

Ok, weird ^^ Sorry I don’t use DBeaver; you’ll have to check if there’s some subtlety.

Maybe the DuckDB documentation might be helpful:

> **[DBeaver SQL IDE](https://duckdb.org/docs/guides/sql_editors/dbeaver)**
>
> DBeaver is a powerful and popular desktop sql editor and integrated development environment (IDE). It has both an open source and enterprise version. It is useful for visually inspecting the available tables in DuckDB and for quickly building complex...

---

<div class="post-metadata">

**Author:** ![jean\_bruder](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/jean_bruder/32/13_2.png) [@jean\_bruder](https://community.gladysassistant.com/u/jean_bruder)\
**Post date:** [August 29, 2024, 8:45am UTC](https://community.gladysassistant.com/t/resolu-faire-des-modifications-directement-dans-la-bdd/9059/20 "2024-08-29T08:45:29Z")

</div>

Hello @guim31

This brings up again a topic that had been discussed regarding starting a container as a user other than «&nbsp;root&nbsp;»: could we create a thread to establish good containerization practices?

Have a nice day,  
Jean
