mirror of
				https://github.com/fastapi/sqlmodel.git
				synced 2025-10-28 20:23:47 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| # Tutorial - User Guide
 | |
| 
 | |
| In this tutorial you will learn how to use **SQLModel**.
 | |
| 
 | |
| ## Type hints
 | |
| 
 | |
| If you need a refresher about how to use Python type hints (type annotations), check <a href="https://fastapi.tiangolo.com/python-types/" class="external-link" target="_blank">FastAPI's Python types intro</a>.
 | |
| 
 | |
| You can also check the <a href="https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html" class="external-link" target="_blank">mypy cheat sheet</a>.
 | |
| 
 | |
| **SQLModel** uses type annotations for everything, this way you can use a familiar Python syntax and get all the editor support possible, with autocompletion and in-editor error checking.
 | |
| 
 | |
| ## Intro
 | |
| 
 | |
| This tutorial shows you how to use **SQLModel** with all its features, step by step.
 | |
| 
 | |
| Each section gradually builds on the previous ones, but it's structured to separate topics, so that you can go directly to any specific one to solve your specific needs.
 | |
| 
 | |
| It is also built to work as a future reference.
 | |
| 
 | |
| So you can come back and see exactly what you need.
 | |
| 
 | |
| ## Run the code
 | |
| 
 | |
| All the code blocks can be copied and used directly (they are tested Python files).
 | |
| 
 | |
| It is **HIGHLY encouraged** that you write or copy the code, edit it, and run it locally.
 | |
| 
 | |
| Using it in your editor is what really shows you the benefits of **SQLModel**, seeing how much code it saves you, and all the editor support you get, with autocompletion and in-editor error checks, preventing lots of bugs.
 | |
| 
 | |
| Running the examples is what will really help you understand what is going on.
 | |
| 
 | |
| You can learn a lot more by running some examples and playing around with them than by reading all the docs here.
 | 
