Forum > General

Realtime Database

(1/1)

sergio.garcia:
Please, does anyone know how to authenticate and access Firebase's Realtime database through Lazarus? Thanks

Thaddy:
FireBIRD is not a good idea for real time or near-real time access. Use a proper database ( and yes that is expensive)

Zoran:

--- Quote from: Thaddy on September 29, 2022, 06:01:08 pm ---FireBIRD is not a good idea for real time or near-real time access. Use a proper database ( and yes that is expensive)

--- End quote ---

Thaddy, the question is about Google's Firebase Realtime Database, not Firebird.

Zvoni:
Since FireBase is a NoSQL-Database --> https://forum.lazarus.freepascal.org/index.php?topic=36965.0
mORMot?

Leledumbo:
Fortunately, Google always implements things in language independent way, despite providing easy to use wrappers for certain languages.
Rest API is the way to go. Follow all steps in that link then you can turn the cURL commands into the equivalent for fphttpclient or whatever HTTP client library of your choice. After all, that's what the wrappers do.

For instance, the example:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---curl -X PUT -d '{  "alanisawesome": {    "name": "Alan Turing",    "birthday": "June 23, 1912"  }}' 'https://docs-examples.firebaseio.com/fireblog/users.json' is equivalent to:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---uses  fphttpclient,fpjson;...var   obj: TJSONObject;...with TFPHTTPClient.Create(nil) do  try    obj := TJSONObject.Create;    obj.Strings['author'] := 'alanisawesome';    obj.Strings['title'] := 'The Turing Machine';    RequestBody := TRawByteStringStream.Create(obj.AsJSON);    obj.Free;     WriteLn(Put('https://docs-examples.firebaseio.com/fireblog/users.json'));  finally    Free;  end; 

Navigation

[0] Message Index

Go to full version