8
votes
Accepted
A demonstrational example of a Data mapper ORM
I don't fully understand the desire for a "generic" data mapper. Oftentimes, flexibility leads to complexity and fragility in your application. Take for example your ...
6
votes
Building a simple ORM in PHP
One thing I believe is obvious is that your ORM is subject to SQL injection unless I am missing something.
For example, in my understanding, you could make something like this
...
4
votes
Accepted
Unit testing a REST API in Go
OK, so a bit later than I expected, but here's some comments I have. I'll try to address the concerns you list to a reasonable degree:
I didn't manage to mock DB, that's why I am using an in-memory ...
4
votes
Unit testing a REST API in Go
Here are some notes I made while reading your code.
For a real-world code review, code should be correct, maintainable, reasonably efficient, and, most importantly, readable.
Writing code is a ...
3
votes
A demonstrational example of a Data mapper ORM
I'm not sure if it was intentional but it appears that for the most part PSR-2 is being followed, except that in save() the opening braces for the control ...
3
votes
A simple User class
The comment by mferly is very constructive:
Comment your code/methods/properties/everything. Seriously. In your getUsers() method, is the ...
3
votes
Accepted
Password field based on peewee ORM framework
All in all, I find the code very well written.
I don't really understand the purpose of the Argon2Hash.create class method, but I'd venture it is for convenience ...
3
votes
Building a simple ORM in PHP
I am particularly interested in how ORMs really work, but not succeeded with writing an exemplary mapper yet. So I am really interested in your approach, which is quite good to my taste, save for ...
3
votes
Inventory Management System
This is a very naive approach to the issue and it's a race condition away from being a day+ debugging nightmare for you.
...
3
votes
2
votes
Rails model for aggregate data instead of a real table
I agree with you that this does not really fit a service nor a model. This might be more like a Query object.
...
2
votes
Unit testing a REST API in Go
You can simplify your build and allow for easier integration tests* with a docker-compose.yml file.
...
2
votes
Inventory Management System
looking for some feedback
We have some nouns, here.
I don't see any verbs.
Certainly there is no
test suite.
It's unclear what entrypoint someone
would use to exercise this codebase.
I imagine there ...
1
vote
Validating an input in a chatbot
I think the best option is to implement the validate function inside task class. It should be a behaviour of the task class.
And why don't you use polymorphism here? You have ...
1
vote
Object relational mapper - optimize in memory data representation and code improvements
It's not related to your four questions but the most important thing for me is that your library is not (yet) an ORM from my point of view.
An ORM is supposed to map Object and it's properties to a ...
1
vote
django multiple if else refactor
Well finally I ended up with the following, I changed some names to make it more explanatory and the function to respond to an ajax request. However the logic is pretty much the same:
...
1
vote
Accepted
Flask Database Design with ORM
At the end of the day I used pandas.
df = pandas.read_sql_query("""My join query""")
This all just solved my problem.
1
vote
PHP - Saving inbound email and its attachment
It can be more efficient
It seems okay to use the create() method to insert a document record. However, for the sake of efficiency there is a method to create ...
1
vote
Displaying a user profile based on a mock ORM
Pages
You can get rid of a lot of boilerplate with constructor promotion (PHP 8.0):
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
orm × 23python × 11
php × 8
database × 7
python-3.x × 5
object-oriented × 3
design-patterns × 2
django × 2
flask × 2
sqlalchemy × 2
c# × 1
performance × 1
beginner × 1
sql × 1
unit-testing × 1
json × 1
ruby-on-rails × 1
go × 1
typescript × 1
entity-framework × 1
pdo × 1
library × 1
email × 1
serialization × 1
dependency-injection × 1