GodotNuts / GodotFirebase

Implementations of Firebase for Godot using GDScript
MIT License
517 stars 74 forks source link

Firebase Realtime Database DataSnapshot #365

Closed mcoswel closed 7 months ago

mcoswel commented 9 months ago

Apologize for my English, I would like a feature where you could get DataSnapshot of Realtime database. Thank you

WolfgangSenff commented 9 months ago

That already exists - it's not the exact same as the main libraries, but you can get the snapshot from the database reference by using the new_data_update signal.

mcoswel commented 9 months ago

That already exists - it's not the exact same as the main libraries, but you can get the snapshot from the database reference by using the new_data_update signal.

Nope. DataSnapshot is like one time requesting and you get the whole data. new_data_update is emitted for every key. For example: -Parent

WolfgangSenff commented 9 months ago

It's the same as just getting it the first time at the highest level you're trying to get. That said, we have a bug currently with it where it'll just keep going, and I know some people have asked for similar where you can just get it once. I'll see about implementing it at some point.

mcoswel commented 9 months ago

It's the same as just getting it the first time at the highest level you're trying to get. That said, we have a bug currently with it where it'll just keep going, and I know some people have asked for similar where you can just get it once. I'll see about implementing it at some point.

Thank you very much Sir. Would like to see it implemented. Or maybe create a signal which will be emitted when the new_data_update finish it's job.

WolfgangSenff commented 9 months ago

That's good conceptually, but the way it's implemented, it's never finished. :P I will still try to come up with something smart. This one is going to take a while though! Going to require quite a lot of work and document reading. But it's good to bring up! So thank you for posting.

WolfgangSenff commented 7 months ago

Okay, I have implemented this. I'm using the "once" functionality, similar to the JavaScript framework. It is implemented in the test harness as well. I have also implemented delete functionality in the test harness (it was already in the plugin). This is only in 4.x right now, but will be adding it to 3.x when I'm done with work. Finally, #371 (duplicate of this) has also been resolved. https://github.com/GodotNuts/GodotFirebase/commit/b198bd84f5c2d15a933f43ebe058e19611f944ef