Doubling down even further! Did you know the `@transaction` decorator removes almost all database "plumbing" from your Dyne routes? 🛠️ Forget `await req.db` or manual ` await session.commit()` calls. Just decorate your function: it lazily loads the session, commits on success, and automatically rolls back if anything goes wrong. Focus on your logic, not the infrastructure: https://lnkd.in/eqEc4Tuw #Python #SQLAlchemy #Backend #DyneFramework #WebDev
Remove Database Plumbing with @transaction Decorator in Dyne Routes
More Relevant Posts
-
A common pain point for growing local businesses: The "Slow Dashboard." I recently audited a legacy Python backend where a single report generation was taking 45 seconds. The fix wasn't a faster server or a complex cache. It was fixing a series of N+1 queries and adding a composite index on the database. The Result: 45 seconds down to 0.8 seconds. If your software is slowing down as your business grows, you usually don't need a total rewrite. You need a targeted performance audit. #Python #DatabaseOptimization #Performance #LocalBusinessTech
To view or add a comment, sign in
-
I was looking at the Dataverse Python package documentation today morning and there was this specific paragraph. 𝘚𝘘𝘓 𝘲𝘶𝘦𝘳𝘪𝘦𝘴 𝘢𝘳𝘦 𝘦𝘹𝘦𝘤𝘶𝘵𝘦𝘥 𝘥𝘪𝘳𝘦𝘤𝘵𝘭𝘺 𝘢𝘨𝘢𝘪𝘯𝘴𝘵 𝘵𝘩𝘦 𝘦𝘯𝘵𝘪𝘵𝘺 𝘴𝘦𝘵 𝘦𝘯𝘥𝘱𝘰𝘪𝘯𝘵𝘴 𝘶𝘴𝘪𝘯𝘨 𝘵𝘩𝘦 "?𝘴𝘲𝘭=" 𝘱𝘢𝘳𝘢𝘮𝘦𝘵𝘦𝘳. 𝘚𝘶𝘱𝘱𝘰𝘳𝘵𝘦𝘥 𝘴𝘶𝘣𝘴𝘦𝘵 𝘰𝘯𝘭𝘺 (𝘴𝘪𝘯𝘨𝘭𝘦 𝘚𝘌𝘓𝘌𝘊𝘛, 𝘰𝘱𝘵𝘪𝘰𝘯𝘢𝘭 𝘞𝘏𝘌𝘙𝘌/𝘛𝘖𝘗/𝘖𝘙𝘋𝘌𝘙 𝘉𝘠, 𝘢𝘭𝘪𝘢𝘴). 𝘜𝘯𝘴𝘶𝘱𝘱𝘰𝘳𝘵𝘦𝘥 𝘤𝘰𝘯𝘴𝘵𝘳𝘶𝘤𝘵𝘴 𝘢𝘳𝘦 𝘳𝘦𝘫𝘦𝘤𝘵𝘦𝘥 𝘣𝘺 𝘵𝘩𝘦 𝘴𝘦𝘳𝘷𝘪𝘤𝘦. I never read any documentation about this "sql" parameter before and it surprisingly worked when I tried it. #TIL
To view or add a comment, sign in
-
-
🚀 Day 6/30 | LeetCode Problem: Move Zeroes (283) Problem: Given an array nums, move all 0s to the end of the array while maintaining the relative order of non-zero elements. The operation must be done in-place. Approach: Traverse the array once Store all non-zero elements in one list Store all zero elements in another list Combine both lists and update the original array This approach keeps the order intact and is easy to understand. Time Complexity: O(n) Space Complexity: O(n) Python Code: class Solution(object): def moveZeroes(self, nums): a = [] b = [] for i in nums: if i == 0: a.append(i) else: b.append(i) nums[:] = b + a Example: Input: [0,1,0,3,12] Output: [1,3,12,0,0] Takeaway: Maintaining order while modifying arrays is a common requirement in real-world problems. 📌 Accepted ✅ | All test cases passed 🔖 Hashtags #LeetCode #30DaysOfLeetCode #Day6 #Python #Arrays #DSA #ProblemSolving #CodingJourney #SoftwareEngineering #TechCommunity
To view or add a comment, sign in
-
-
Day 43 of 365 days of code Qn 1) simplify path approach used: stack initialize a stack 1) iterate the string path using var i from 0 to len(path) 2) ignore forward slashes 3) initialize ch="" 4) while i<len(path) and path[i] not equal to forward slash: ch+=path[i];i+=1 5) if ch==.. stack.pop elif ch== . continue else: stack.push(ch) 6)i+=1 7) pop all the element of the stack and put them in another stack 8) initialize a string starting with/ as u iterate pop the stack and add the forward slash to the popped string. #365daysOfCode #NeetCode #leetcode #DSA #python #LeetCode #ProblemSolving #Algorithms
To view or add a comment, sign in
-
-
Functions are the building blocks of any serious Python application. They allow us to organize code into manageable, reusable chunks. If you are just starting out, the syntax can sometimes be confusing. Here is a quick cheat sheet on how to structure them properly. The Flow: Start with the def keyword. Give it a clear, descriptive name (like greet_person shown below). Pass data in using arguments. Send data back using return. Once you master this, you are ready to tackle modules and classes! #PythonLearning #CodingTips #DeveloperCommunity #DataScience #TechEducation
To view or add a comment, sign in
-
-
I kept reaching for Great Expectations for very small pandas checks, but it often felt heavier than what I needed. So I built a tiny, code-first alternative focused on fast sanity checks for pandas DataFrames. `pip install mini-expectations` It’s meant for notebooks and small pipelines where YAML/config overhead feels like overkill. Would genuinely love feedback from folks doing pandas-based data validation or lightweight data pipelines. #Python #DataEngineering #DataQuality #OpenSourceSoftware
To view or add a comment, sign in
-
Today marked the final deep dive into Python’s exception handling framework. The focus was on moving beyond built-in errors and managing external resources safely. Technical Focus: • Custom Exception Classes: Designing domain-specific exceptions by inheriting from the Exception base class to improve code readability and debugging. • Context Managers: Leveraging the with statement for automatic resource management, ensuring file handles are closed even when errors occur. • Resilient File Handling: Combining try-except blocks with file I/O to handle FileNotFoundError and permission issues gracefully. • Applied Logic: Integrated these concepts into a mini-project to simulate real-world failure scenarios and recovery. Closing the loop on exceptions to ensure every system I build is failure-tolerant. 138 days to go. #Python #SoftwareEngineering #ErrorHandling #CleanCode #150DaysOfCode #InterviewPrep
To view or add a comment, sign in
-
In this part 6 of this DSA in python series I have practiced Reversing and rotation of arrays up to ' n ' number of times. This included some logical operations and application of loops . Stay tuned for the upcoming parts... https://lnkd.in/deDm-jU4
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development