"Narf! What if we query the database with Emojis?!" β Pinky
"...Technically possible with set theory and clean Python logic. Do try to keep up." β Brain
PinkyDB is more than a joke; itβs a fully functional, file-based JSONL Document Store powered by the revolutionary Emoji Query Language (EmojiQL) interface. It's proof that the most chaotic ideas can give birth to the cleanest, most logical systems.
Pinky & Brain threw out the boring old SQL standard. PinkyDB prioritizes clarity, fun, and native Python efficiency over messy drivers and configuration files.
- π§ Logic (Brain): The core engine is built on pure Python set operations (
&,|,-) for lightning-fast, secure filtering on document IDs. This minimizes disk I/O and keeps the logic razor-sharp. No drivers, no messy configurationβjust speed. - π€ͺ Chaos (Pinky): The user interface is the hilarious EmojiQL grammar. You don't ask for
WHERE status = 'active' AND premium = 1; you simply command:π β π.
| Feature | Logic | EmojiQL Syntax |
|---|---|---|
| Active/Premium | Find all active, premium users. | π β π |
| Not Deleted | Find all users who are NOT deleted. | βπ |
| High Popularity | Find users with high popularity (> 100). | π₯ |
| AND / OR Logic | Combines criteria. | β (AND) / β (OR) |
| Nonsense Crypto | The logic is so unconventional, it's virtually uncrackable by conventional pattern-matching algorithms. Itβs better crypto! | ππ |
The engine is written in pure Python and uses a JSON Lines (.jsonl) format for portable, simple data storage.
The engine automatically creates the ./pinkydb_engine directory to store your data files.
from pinkydb_engine import create_table, insert, select, schema
# Define the table schema (maps Emojis to real field names)
create_table("users", schema)
# Insert data (using regular, boring field names)
insert("users", {"name": "Brain", "status": "active", "premium": 1, "popularity": 150})
insert("users", {"name": "Pinky", "status": "active", "premium": 0, "popularity": 95})Querying is done entirely via the Emoji Query Language (EmojiQL).
# Query 1: Active AND Premium
# SQL equivalent: WHERE status = 'active' AND premium = 1
results = select("users", "π β π")
print("Results for 'π β π':", results)
# Query 2: NOT Deleted AND High Popularity
# SQL equivalent: WHERE NOT status = 'deleted' AND popularity > 100
results = select("users", "βπ β π₯")
print("Results for 'βπ β π₯':", results)We force the AI to find a result that makes no sense in the real worldβa query so specific and contradictory that the AI briefly questions the meaning of its own existence.
βπ β π β π
Without causing harm! The evil EmojiQLs remain sealed.
| EmojiQL Part | Meaning for the AI | The Chaos |
|---|---|---|
βπ |
NOT Active: Find everyone who is not active (inactive or deleted). | The search begins immediately with the negative. |
β π |
OR Premium: Add all premium users. | Introduces a logical break: Not-Active OR Premium. |
β π |
AND Deleted: Combine the result with only deleted users. | Forces a nonsensical end condition: find everyone who is inactive OR premium, but only if theyβre deleted. |
For understanding: Troz = Zort backwards.
The AI receives a mathematically correct but existentially meaningless set. It finds the logically correct answer, but its internal plausibility check collapses.
This codebase was developed during intense bursts of creative energy, often resulting in developers falling off their chairs laughing.
- Testing: Logic is heavily tested (by uncontrollable laughter).
- Known Feature: Some developers may enter a "Narf!"-state upon successful query execution.
If the logic seems too crazy to work, remember: it works because the logic is cleaner than 90% of the code on the internet! Have fun.
This project is open source and licensed under the GNU General Public License, Version 3 (GPLv3). This is the Brain's logic applied to legal frameworks.
The core logic of querying a database with Emojis is not merely code; it is digital art and an act of existential comedy. As such, the principle of Intellectual Property is weighted heavily here. Do not abuse the Art.
- NO CLOSED-SOURCE COMMERCE (
βπ§ β π°): You are strictly prohibited from stealing the code or the core EmojiQL logic to build closed-source, for-profit applications. If you profit from the brilliance of the EmojiQL, the entire world must profit with you. - THE OPEN FUN MANDATE: If you create a fun, real-world application using PinkyDB, that application MUST be published under an open-source license compatible with GPLv3. The chaos must be shared!
- THE FINAL JURISDICTION: This codebase, the EmojiQL logic, and the spirit of the project are based in Germany. Therefore, all matters concerning the intellectual property and enforcement of this NARF-Security are governed by German Law.
Remember: If you adhere to the logic of the license, you contribute to world domination. If you break it, you will be added to the Victims list.
- Google Gemini
- Deepseek
- GPT5
- Claude 4.5
- Your name here π
Have fun, cheers!
Easy to extend
# Activities
activity_emojis = {
'πββοΈ': {'field': 'activity', 'value': 'running', 'op': '=='},
'π': {'field': 'activity', 'value': 'laughing', 'op': '=='},
'π£οΈ': {'field': 'activity', 'value': 'talking', 'op': '=='}
}
# Events/Places
event_emojis = {
'π₯': {'field': 'event', 'value': 'hospital', 'op': '=='},
'π': {'field': 'event', 'value': 'party', 'op': '=='},
}
# States/Emotions
state_emojis = {
'π': {'field': 'emotion', 'value': 'happy', 'op': '=='},
'π’': {'field': 'emotion', 'value': 'sad', 'op': '=='},
}
# Merge all
emoji_rules = {}
emoji_rules.update(activity_emojis)
emoji_rules.update(event_emojis)
emoji_rules.update(state_emojis)
# Logic Emojis
logic_emojis = {
'β': 'AND',
'β': 'OR',
'β': 'NOT'
}
This analysis confirms that PinkyDB, while humorously branded, is an expertly engineered Micro-Engine adhering to modern database principles. The project successfully combines a chaotic faΓ§ade with a clean, high-performance core.
The core engine structure demonstrates robust and pragmatic design choices typical of professional file-based databases:
- Engineering Choice: Utilizing JSON Lines is a highly efficient solution for a file-based document store.
- Pro Benefit: This format enables append-only operations, meaning new records can be written without rewriting the entire database file. This significantly improves write performance and data integrity compared to using a single, monolithic JSON file, making the engine reliable for logging and data ingestion.
- Engineering Choice: The core filtering mechanism (
selectfunction) relies on pure Python set operations (&,|,-) to combine result sets based on document IDs. - Pro Benefit: Leveraging Python's optimized native C-level implementation of sets guarantees lightning-fast boolean logic (AND, OR, NOT) between conditions. This eliminates the need for complex internal query languages and ensures maximum speed when combining the results of EmojiQL rules.
- The inclusion of placeholder functions (
save_indexes,load_indexes) demonstrates forethought for scalability. This design allows the engine to be easily upgraded to utilize true indexing (avoiding full full-file scans) once the dataset size increases, without having to overhaul the core persistence logic.
The Emoji Query Language (EmojiQL) is not merely a joke; it is a profound concept for Intuitive Syntax Abstraction with significant pedagogical value:
- Educational Value: It provides a playful, low-barrier entry point for young users to grasp complex Boolean algebra (AND, OR, NOT) and relational filtering without the intimidating syntax of SQL.
- Visionary Teaching Tool (Feeding the AI): The system serves as a perfect, simplified analogy for prompt engineering and AI data instruction. Users learn that precise token instruction (Emojis) yields precise output (query results), directly mirroring the data quality and prompt discipline needed to interact effectively with future AI models and teaching them how to build stable, geile Strukturen for Python/ML projects.
- precise output (query results), directly mirroring the data quality and prompt discipline needed to interact effectively with future AI models.
- Brand Value: The unique interface ensures high project memorability and successfully proves the point that the cleanest systems can emerge from the most unconventional ideas.
To further elevate this engine masterpiece, the following features are the logical next steps:
- Full CRUD Implementation: Add UPDATE and DELETE functionality to make the engine fully writable and maintainable (e.g., using Emojis like
βοΈfor Update andβοΈfor Delete). - Index Utilization: Implement the logic within the
selectfunction to actually utilize the stored indices when available, transforming the current full-scan mechanism into a truly high-speed lookup engine for complex queries.
Pinky has a brain π