Hi
@aeric,
I was wondering: "More examples," but where's an example here?
Then I downloaded the library and the project template and realized the template itself "is" the example.
It's both a mistake and a useful thing that the template contains an actual project.
It's useful because you immediately have a complete example;
it's a mistake because a template should be almost entirely empty, otherwise it requires great care in eliminating anything you don't need.
This is the mistake I made recently when I thoughtlessly created the B4XPagesAndDrawer template, incorporating Erel's entire example into it.
Two more little things.
I haven't been on GitHub very often (a shortcoming I need to address); where can I find the other examples (although the template is enough for me, I'm asking you specifically to understand GitHub)?
Finally, a superfluous suggestion because it's obvious you're an expert:
Instead of having to write the DBType as a literal (DBType doesn't suggest which ones), it would be better to provide constants (Erel, are you reading this? Why don't you implement Enums?

)
I am happy to see questions!

Let me answer them one by one.
I was wondering: "More examples," but where's an example here?
There are actually indeed more examples on GitHub Readme.
The extra examples are:
- Soft delete row
- Permanent delete row
- Batch delete rows
- Return number of rows in query results
- Return single row
- Return multiple rows
- Join tables
Then I downloaded the library and the project template and realized the template itself "is" the example.
Yes! You are right.
This template
[B4X] [Project Template] MiniORM is a complete working project.
It's both a mistake and a useful thing that the template contains an actual project.
It's useful because you immediately have a complete example;
Yes, because I think it can be a
good starter project to extend further for many more purposes. e.g as a POC.
it's a mistake because a template should be almost entirely empty, otherwise it requires great care in eliminating anything you don't need.
My
concern is developers
new to MiniORM will face difficulty to understand the concept.
The project template can let them see an
immediate result without starting to read the documentation. It is almost
zero configuration.
In fact, my real world projects are much more complicated.
Another advantage of project template is you can use
any name for the project and usually created in a
frequently use development path (more organized).
There are more reasons and benefits of project template instead of a "zipped" project file but I stopped here.
By the way, the
main purpose of this project template is to
showcase one of the uses of this library; for creating B4X cross platforms client apps (B4A, B4i, B4J).
Whilst MiniORMUtils can be use for UI apps for B4X, it is also part of the dependencies of Pakai framework which is a
non-ui web server solution.
MiniORMUtils has a great "history".
Actually there is a more powerful library (now call
CapORM) which is not generally available.
It supports wider database type i.e
MS SQL Server, PostgreSQL and Firebird instead of only SQLite and MySQL/MariaDB
MiniORM is just a sub library.
The project template is guaranteed in high quality, well tested and clean of redundant files.
The file size is very small.
If you want, you can modify the template or remove the parts you think you don't want.
Then create your own version. The freedom is on your hand.
This is the mistake I made recently when I thoughtlessly created the B4XPagesAndDrawer template, incorporating Erel's entire example into it.
I don't agree it is a mistake.
Project Template can also be use as DRY principle (Don't Repeat Yourself).
It is a good way to start a project from a clean but included with features that are ready to be used.
My Pakai Server template is the best example I can think of.
Everything is ready to run. I can extend the generated boilerplate to many types of server apps.
You help other developers saving their time looking for other piece of puzzle.
I haven't been on GitHub very often (a shortcoming I need to address); where can I find the other examples (although the template is enough for me, I'm asking you specifically to understand GitHub)?
Mentioned above,
Pakai Server is the best mate for MiniORMUtils. You can just run it with SQLite backend. Zero configuration.
Another example is
User Login Server but it is based on older version of libraries.
Instead of having to write the DBType as a literal (DBType doesn't suggest which ones), it would be better to provide constants
The constants are already existed in MiniORM class.
Public Const MYSQL As String = "MYSQL"
Public Const SQLITE As String = "SQLITE"
Public Const MARIADB As String = "MARIADB"
For other questions, I welcome you to start a new thread.