Recent

Author Topic: Recommendations on web based database application  (Read 5695 times)

Robert.Thompson

  • Jr. Member
  • **
  • Posts: 56
  • "A very bad coder."
    • Google Voice for Canadians
Recommendations on web based database application
« on: November 18, 2018, 08:12:59 pm »
Hello:

I would like to create a simple front-end to a cloud-based database (MySQL/Maria ?) web application using Lazarus.

There will not be many tables (20), nor will there be many records in each table. (1000 max)
There will only be 7 users and only one user will have the ability to add or change data.

My question is: Which Lazarus database components would be the easiest to use to accomplish this, or, would I be better off using some non-free components? If so, which ones do you recommend?

Thanks,
Rob.


Lazarus:  1.8.4  2018-11-17
FPC:   3.0.4
      x86_64-linux-gtk2
System:   Host: rob-R580-R590 Kernel: 4.15.0-39-generic x86_64 bits: 64 gcc: 7.3.0
              Desktop: Cinnamon 3.8.9 (Gtk 2.24.32) dm: lightdm Distro: Linux Mint 19 Tara
Machine:   Device: laptop System: SAMSUNG product: R580/R590  Chassis: type: 9
                 BIOS: Phoenix v: 11JB.M044.20100622.hkk date: 06/22/2010
CPU:       Dual core Intel Core i5 M 460 (-MT-MCP-) arch: Nehalem rev.5 cache: 3072 KB
Graphics Card: NVIDIA GT218M [GeForce 310M] bus-ID: 02:00.0 chip-ID: 10de:0a75
Lazarus:  1.8.4  2018-11-17
FPC:   3.0.4 x86_64-linux-gtk2
System:   Kernel: 4.15.0-39-generic x86_64 bits: 64 gcc: 7.3.0 Cinnamon 3.8.9 Linux Mint 19 Tara
              Phoenix v: 11JB.M044.20100622.hkk date: 06/22/2010
Intel Core i5 M 460 (-MT-MCP-) arch: Nehalem rev.5 cache: 3072 KB
NVIDIA GeForce 310M

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Recommendations on web based database application
« Reply #1 on: November 18, 2018, 11:32:44 pm »
I would like to create a simple front-end to a cloud-based database (MySQL/Maria ?) web application using Lazarus.
[. . .]
My question is: Which Lazarus database components would be the easiest to use to accomplish this, or, would I be better off using some non-free components? If so, which ones do you recommend?

That depends on whether you mean a database front-end, i.e. your application accesses directly a remote database; or a web-application front-end, i.e. your application accesses a web service which in turn acceses the database and returns the results to you.

In the first case, you may start reading from the wiki portal: Databases or the article Databases, and following the links that may interest you (like p.e. MySQL and MariaDB Databases).

In the second case the starting point can be the Web Development portal, which links to p.e. the Web Service Toolkit, among others.

Whichever you meant, there are enough built-in and/or free source third-party solutions so as to render unnecessary to seek non-free ones. Good luck! :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Robert.Thompson

  • Jr. Member
  • **
  • Posts: 56
  • "A very bad coder."
    • Google Voice for Canadians
Re: Recommendations on web based database application
« Reply #2 on: November 19, 2018, 03:58:25 am »
Thanks lucamar. :)

It would be "a web-application front-end."

I have a book that speaks about the "Brook Framework" and that is what I will try to install.

Rob.
Lazarus:  1.8.4  2018-11-17
FPC:   3.0.4 x86_64-linux-gtk2
System:   Kernel: 4.15.0-39-generic x86_64 bits: 64 gcc: 7.3.0 Cinnamon 3.8.9 Linux Mint 19 Tara
              Phoenix v: 11JB.M044.20100622.hkk date: 06/22/2010
Intel Core i5 M 460 (-MT-MCP-) arch: Nehalem rev.5 cache: 3072 KB
NVIDIA GeForce 310M

asdf121

  • New Member
  • *
  • Posts: 35
Re: Recommendations on web based database application
« Reply #3 on: November 19, 2018, 08:17:48 am »
I would recommend Synopse mORMot Framework. Very well documented and should fulfill all your needs.

Renat.Su

  • Full Member
  • ***
  • Posts: 230
    • Renat.Su
Re: Recommendations on web based database application
« Reply #4 on: November 19, 2018, 11:31:32 am »
For example, BrookFramework, Mormot, TNs_HTTPRestFramework.
I used BrookFramework.
There is a fast object persistence plugin (dopf) for database isolation (You can select MySQL, SQLite, postgreSQL etc). With so little data and that access to edit will be only one user I would recommend using SQLite as an DB engine
« Last Edit: November 19, 2018, 11:35:02 am by Renat.Su »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Recommendations on web based database application
« Reply #5 on: November 22, 2018, 05:28:16 am »
My question is: Which Lazarus database components would be the easiest to use to accomplish this, or, would I be better off using some non-free components? If so, which ones do you recommend?
Handcoded SQLdb is enough. If you want to use proprietary ORM, EntityDAC looks good to me from browsing the documentation. It's quite unclear whether it supports Lazarus or not, but the whole devart's DAC page has Lazarus in the title.

Robert.Thompson

  • Jr. Member
  • **
  • Posts: 56
  • "A very bad coder."
    • Google Voice for Canadians
Re: Recommendations on web based database application
« Reply #6 on: November 23, 2018, 06:30:37 pm »
Thanks, Leledumbo.

Is there a tutorial available that will show me how to accomplish what I want to do by 'handcoding'?

I would like to give that a try.

Rob.
Lazarus:  1.8.4  2018-11-17
FPC:   3.0.4 x86_64-linux-gtk2
System:   Kernel: 4.15.0-39-generic x86_64 bits: 64 gcc: 7.3.0 Cinnamon 3.8.9 Linux Mint 19 Tara
              Phoenix v: 11JB.M044.20100622.hkk date: 06/22/2010
Intel Core i5 M 460 (-MT-MCP-) arch: Nehalem rev.5 cache: 3072 KB
NVIDIA GeForce 310M

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Recommendations on web based database application
« Reply #7 on: November 27, 2018, 08:57:16 pm »
Thanks, Leledumbo.

Is there a tutorial available that will show me how to accomplish what I want to do by 'handcoding'?

I would like to give that a try.

Rob.
Assuming you have understood how the components connected to each other (mainly TSQLTransaction, TSQLQuery and a TSQLConnection of your choice) using drag n drop, just create the instances and assign the properties manually. I'm not aware of any tutorial, but here's a concise example:
Code: Pascal  [Select][+][-]
  1. uses
  2.   db, sqldb, mysql56conn;
  3. var
  4.   Conn: TSQLConnector;
  5.   Query: TSQLQuery;
  6.   F: TField;
  7. begin
  8.   Conn := TSQLConnector.Create(nil);
  9.   with Conn do begin
  10.     ConnectorType := 'mysql 5.6';
  11.     HostName := 'localhost';
  12.     DatabaseName := 'information_schema';
  13.     UserName := '';
  14.     Password := '';
  15.     Transaction := TSQLTransaction.Create(Conn);
  16.   end;
  17.  
  18.   Query := TSQLQuery.Create(nil);
  19.   Query.DataBase := Conn;
  20.  
  21.   Query.SQL.Text := 'select * from tables';
  22.   Query.Open;
  23.   while not Query.EOF do begin
  24.     for F in Query.Fields do begin
  25.       Write(F.FieldName,' = ');
  26.       if F.IsNull then WriteLn('NULL') else WriteLn(F.Value);
  27.     end;
  28.     WriteLn;
  29.     Query.Next;
  30.   end;
  31.   Query.Close;
  32.   Query.Free;
  33.   Conn.Free;
  34. end.
  35.  

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Recommendations on web based database application
« Reply #8 on: November 27, 2018, 11:11:32 pm »
Is there a tutorial available that will show me how to accomplish what I want to do by 'handcoding'?

I would like to give that a try.

About SQLdb? In the wiki:
among others.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Robert.Thompson

  • Jr. Member
  • **
  • Posts: 56
  • "A very bad coder."
    • Google Voice for Canadians
Re: Recommendations on web based database application
« Reply #9 on: November 29, 2018, 06:46:45 pm »
Thanks Leledumbo & lucamar. :)

I'm off to give it a try.

Rob.
Lazarus:  1.8.4  2018-11-17
FPC:   3.0.4 x86_64-linux-gtk2
System:   Kernel: 4.15.0-39-generic x86_64 bits: 64 gcc: 7.3.0 Cinnamon 3.8.9 Linux Mint 19 Tara
              Phoenix v: 11JB.M044.20100622.hkk date: 06/22/2010
Intel Core i5 M 460 (-MT-MCP-) arch: Nehalem rev.5 cache: 3072 KB
NVIDIA GeForce 310M

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
Re: Recommendations on web based database application
« Reply #10 on: November 30, 2018, 08:47:57 am »
Quote
I would like to create a simple front-end to a cloud-based database (MySQL/Maria ?) web application using Lazarus.
If it was simple, everyone is doing it.

Using cloud-base database has two way's:
- Building a server site application for connecting the database and his queries.
- Building a client site that commucates with the serversite.

That's why tools like mORMot and TIOPF are recommended.

Brooks framework is a serverside tool that runs in a browser. You build and compile an application in lazarus and run it on your webserver.
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

 

TinyPortal © 2005-2018