TFDMemTable equivalent in Lazarus lazarus / 16-Databases ---------------------------------------------------------------------- Saylo_49 · 2020-06-09 18:29 Hello, I have a middle size project written in Delphi 10.3.3 Rio with FireMonkey framework. This project, on the FormCreate, will load data from external file to FDMemTable (In-memory dataset). FDMemTable's fields are connected by LiveBindings to many Labels to show the stored data. There is only the FDMemTable, no SQL connection, no SQL query, no external database engine (like MySQL or FireBird), no SQL or other DB control at all. The whole project work fine on Windows and Android. Now, I want to port this project to Linux, and later to Web (Website or Browser extensions) by Pas2JS. The used FMX controls can be replaced by LCL for Linux, and by Pas2JS Widgetset (Heliosroots project : https://github.com/heliosroots/Pas2JS_Widget) for the Web. But, what are the equivalent of TFDMemTable for both platforms to implement an independent In-Memory dataset ?? I saw the TBufDataset and the TMemDataset, they can load data from external CSV files, but I don't know if they can work for both platforms, and I am not sure if each one can work totally independent (I need to know if they don't need to drop any additional control like TSQLConnection or Query or Transaction or else on the form, or to deploy external libraries with the final binary). Please, any hints ? ---------------------------------------------------------------------- howardpc · 2020-06-09 21:29 I think TBufDataset may suit your purpose. It has no external dependencies beyond the FCL (and no built-in SQL functionality), and is more capable than TMemDataset. ---------------------------------------------------------------------- Saylo_49 · 2020-06-09 23:04 Quote from: howardpc on June 09, 2020, 11:29:57 pmI think TBufDataset may suit your purpose. It has no external dependencies beyond the FCL (and no built-in SQL functionality), and is more capable than TMemDataset. This TBufDataset can be compiled by Pas2JS ? And how to link it to other controls like the DataControls tab ? ---------------------------------------------------------------------- mangakissa · 2020-06-10 06:29 QuoteAnd how to link it to other controls like the DataControls tab ?TSQLQuery = class  (TCustomSQLQuery) = class (TCustomBufDataset). With a datasource its works perfect. ---------------------------------------------------------------------- PascalDragon · 2020-06-10 07:22 Quote from: Saylo_49 on June 10, 2020, 01:04:26 amThis TBufDataset can be compiled by Pas2JS ? TBufDataset is FPC only. The closest in pas2js is probably TJSONDataset in unit JSONDataset, though I have not tested it. Quote from: Saylo_49 on June 10, 2020, 01:04:26 amAnd how to link it to other controls like the DataControls tab ? With the LCL you need to use a TDataSource as the in-between. Essentially how it was done in Delphi before the Live Bindings were introduced. For pas2js I'd suggest you to use my fork of Heliosroots project, cause I'm still actively working on that (the last commit to the original was around 2 years ago). I have not yet tested data sources and data modules however so I don't know how well these will work. Maybe I'll find the time to take a look at it soon. The idea however is to use the same approach as the LCL uses with TDataSource. Though I'd definitely love to bring a Live Binding-like approach to the LCL (and Pas2JS_Widget as well). Though for that I need to improve some things in the IDE first. ---------------------------------------------------------------------- Saylo_49 · 2020-06-10 19:40 Quote from: PascalDragon on June 10, 2020, 09:22:22 am TBufDataset is FPC only. The closest in pas2js is probably TJSONDataset in unit JSONDataset, though I have not tested it. That's strange, I thought pure Pascal can be compiled to JS. I am just looking for any component to load data from external files, is there any hints ? Quote from: PascalDragon on June 10, 2020, 09:22:22 amFor pas2js I'd suggest you to use my fork of Heliosroots project, cause I'm still actively working on that (the last commit to the original was around 2 years ago). I have not yet tested data sources and data modules however so I don't know how well these will work. Maybe I'll find the time to take a look at it soon. The idea however is to use the same approach as the LCL uses with TDataSource. Thank you for sharing your repo with us, I really need them. And I wish you keep maintaining these gems. Quote from: PascalDragon on June 10, 2020, 09:22:22 amThough I'd definitely love to bring a Live Binding-like approach to the LCL (and Pas2JS_Widget as well). Though for that I need to improve some things in the IDE first. Good luck man, it sound a very complicated task, let us know in case you need help.