Using Dapper: A Practical Guide

For projects with low traffic, I often use Entity Framework for database operations because of its rapid development speed, despite its slower performance. It saves a lot of SQL writing and makes it convenient to handle foreign keys, collections, and more. However, for websites that need to consider runtime speed, I have to use other ORM framew ...

Posted on Thu, 27 Aug 2026 16:48:40 +0000 by jtbaker

Structuring Database Schemas with Django Models

Django's Object-Relational Mapping layer converts Python classes into relational database structures. Defining a model requires subclassing models.Model: from django.db import models class Contributor(models.Model): full_name = models.CharField(max_length=100) contact_email = models.EmailField() is_verified = models.BooleanField(de ...

Posted on Wed, 26 Aug 2026 16:43:26 +0000 by Cbrams

MyBatis Lazy Loading Implementation Guide

Lazy loading is a performance optimization technique used in MyBatis for handling one-to-many or many-to-many relationships during database queries. Consider a scenario with employee and department tables. A typical LEFT JOIN operation would fetch all related data in a single query. However, when department information is rarely accessed, lazy ...

Posted on Wed, 26 Aug 2026 16:30:34 +0000 by rubenc

Implementing CRUD Operations with MyBatis Annotations

While XML configuration remains the predominant approach in MyBatis, annotation-based development offers a streamlined alternative that is widely adopted across other frameworks in the ecosystem. Defining Mapper Interfaces with Annotations Annotate methods directly on the interface to specify SQL queries: public interface UserDao { @Se ...

Posted on Wed, 26 Aug 2026 16:12:43 +0000 by brokenshadows

Getting Started with MyBatis: A Practical Guide

The Evolution of Database Access: Introducing MyBatis In the landscape of database interaction, developers often grapple with the trade-offs between raw JDBC and full-fledged ORM solutions like Hibernate. JDBC, while offering direct control and high performance, demands significant boilerplate code for connection management and manual SQL craft ...

Posted on Tue, 25 Aug 2026 16:48:33 +0000 by judgy

Drogon C++ Web Framework: ORM Integration and CSP Template Rendering

Drogon's Object-Relational Mapping (ORM) layer provides a type-safe, compile-time-checked interface for database interactions. Unlike traditional ORMs in higher-level languages, Drogon’s ORM is synchronous by design—intentionally decoupled from the framework’s asynchronous I/O model. This separation allows developers to choose between high-thro ...

Posted on Sun, 23 Aug 2026 16:58:50 +0000 by garry_224

Database Interaction in Python with PyMySQL and SQLAlchemy ORM

This article explores two primary approaches for interacting with MySQL databases using Python: the low-level driver PyMySQL and the high-level ORM framework SQLAlchemy. PyMySQL PyMySQL is a pure-Python MySQL client library. Its API closely resembles that of MySQLdb, making it a straightforward tool for executing raw SQL. Installation: pip3 ins ...

Posted on Fri, 21 Aug 2026 16:28:53 +0000 by stuartbates

Designing a Custom ORM Using Python Metaclasses

Class ↔ Table, an object instance ↔ a row, an object attribute ↔ a column value, object.attribute ↔ field Store an object → dict → JSON → MySQL MySQL → JSON → dict → reconstruct object Convert all attribute names and values of an object into keys and values of a dictionary Serialize the mapping dictionary into JSON format Encode the JSON dat ...

Posted on Thu, 20 Aug 2026 16:33:37 +0000 by Shellfishman

Mastering Django ORM: Advanced Query Operations, F/Q Expressions, and Transaction Management

1. The 13 Essential QuerySet Methods # all(): Retrieve all objects # filter(**kwargs): Return objects matching given filter criteria # get(**kwargs): Return a single object matching criteria; raises error if none or multiple found # exclude(**kwargs): Return objects not matching filter criteria # values(*field): Return a QuerySet of dictionarie ...

Posted on Sun, 16 Aug 2026 16:26:18 +0000 by PetrZagvazdin

MyBatis Annotation-Based Persistence: From Basic CRUD to Complex Mappings

Core Annotation-Driven Operations Essential MyBatis Annotations Modern Java development favors annotation-based configuration over XML. MyBatis provides a comprehensive set of annotations that eliminate the need for XML mapper files while maintaining full functionality. Key annotations include: @Select: Executes query statements @Insert: Handl ...

Posted on Sun, 16 Aug 2026 16:15:25 +0000 by xengvang