Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 98 for SQL (0.27 sec)

  1. logger/sql.go

    		for _, v := range []byte(sql) {
    			if v == '?' {
    				if len(vars) > idx {
    					newSQL.WriteString(vars[idx])
    					idx++
    					continue
    				}
    			}
    			newSQL.WriteByte(v)
    		}
    
    		sql = newSQL.String()
    	} else {
    		sql = numericPlaceholder.ReplaceAllString(sql, "$$$1$$")
    
    		sql = numericPlaceholderRe.ReplaceAllStringFunc(sql, func(v string) string {
    			num := v[1 : len(v)-1]
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 5K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/sql-databases.md

    ## 审查所有文件
    
    最后回顾整个案例,您应该有一个名为的目录`my_super_project`,其中包含一个名为`sql_app`。
    
    `sql_app`中应该有以下文件:
    
    * `sql_app/__init__.py`:这是一个空文件。
    
    * `sql_app/database.py`:
    
    ```Python
    {!../../../docs_src/sql_databases/sql_app/database.py!}
    ```
    
    * `sql_app/models.py`:
    
    ```Python
    {!../../../docs_src/sql_databases/sql_app/models.py!}
    ```
    
    * `sql_app/schemas.py`:
    
    === "Python 3.10+"
    
        ```Python
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 27K bytes
    - Viewed (0)
  3. docs/em/docs/tutorial/sql-databases.md

     💭 👆 🔜 ✔️ 📁 📛 `my_super_project` 👈 🔌 🎧-📁 🤙 `sql_app`.
    
    `sql_app` 🔜 ✔️ 📄 📁:
    
    * `sql_app/__init__.py`: 🛁 📁.
    
    * `sql_app/database.py`:
    
    ```Python
    {!../../../docs_src/sql_databases/sql_app/database.py!}
    ```
    
    * `sql_app/models.py`:
    
    ```Python
    {!../../../docs_src/sql_databases/sql_app/models.py!}
    ```
    
    * `sql_app/schemas.py`:
    
    === "🐍 3️⃣.6️⃣ & 🔛"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 25.2K bytes
    - Viewed (1)
  4. logger/sql_test.go

    		es                 = ExampleStruct{Name: "test", Val: "test"}
    		intVal   intType   = 1
    		floatVal floatType = 1.23
    	)
    
    	results := []struct {
    		SQL           string
    		NumericRegexp *regexp.Regexp
    		Vars          []interface{}
    		Result        string
    	}{
    		{
    			SQL:           "create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/sql-databases.md

    `sql_app` should have the following files:
    
    * `sql_app/__init__.py`: is an empty file.
    
    * `sql_app/database.py`:
    
    ```Python
    {!../../../docs_src/sql_databases/sql_app/database.py!}
    ```
    
    * `sql_app/models.py`:
    
    ```Python
    {!../../../docs_src/sql_databases/sql_app/models.py!}
    ```
    
    * `sql_app/schemas.py`:
    
    === "Python 3.10+"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 29.6K bytes
    - Viewed (0)
  6. docs/en/docs/how-to/sql-databases-peewee.md

    `sql_app` should have the following files:
    
    * `sql_app/__init__.py`: is an empty file.
    
    * `sql_app/database.py`:
    
    ```Python
    {!../../../docs_src/sql_databases_peewee/sql_app/database.py!}
    ```
    
    * `sql_app/models.py`:
    
    ```Python
    {!../../../docs_src/sql_databases_peewee/sql_app/models.py!}
    ```
    
    * `sql_app/schemas.py`:
    
    ```Python
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 23.6K bytes
    - Viewed (0)
  7. tests/sql_builder_test.go

    	sql = dryRunDB.Or("a = ? or b = ?", "a", "b").Unscoped().Find(&User{}).Statement.SQL.String()
    	if !regexp.MustCompile(`WHERE a = .+ or b = .+$`).MatchString(sql) {
    		t.Fatalf("invalid sql generated, got %v", sql)
    	}
    
    	sql = dryRunDB.Not("a = ? or b = ?", "a", "b").Unscoped().Find(&User{}).Statement.SQL.String()
    	if !regexp.MustCompile(`WHERE NOT \(a = .+ or b = .+\)$`).MatchString(sql) {
    		t.Fatalf("invalid sql generated, got %v", sql)
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_sql_databases/test_sql_databases.py

        tmp_path = tmp_path_factory.mktemp("data")
        cwd = os.getcwd()
        os.chdir(tmp_path)
        test_db = Path("./sql_app.db")
        if test_db.is_file():  # pragma: nocover
            test_db.unlink()
        # Import while creating the client to create the DB after starting the test session
        from docs_src.sql_databases.sql_app import main
    
        # Ensure import side effects are re-executed
        importlib.reload(main)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.1K bytes
    - Viewed (0)
  9. docs/em/docs/how-to/sql-databases-peewee.md

    `sql_app` 🔜 ✔️ 📄 📁:
    
    * `sql_app/__init__.py`: 🛁 📁.
    
    * `sql_app/database.py`:
    
    ```Python
    {!../../../docs_src/sql_databases_peewee/sql_app/database.py!}
    ```
    
    * `sql_app/models.py`:
    
    ```Python
    {!../../../docs_src/sql_databases_peewee/sql_app/models.py!}
    ```
    
    * `sql_app/schemas.py`:
    
    ```Python
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 19.2K bytes
    - Viewed (0)
  10. docs/zh/docs/advanced/async-sql-databases.md

    # 异步 SQL 关系型数据库
    
    **FastAPI** 使用 <a href="https://github.com/encode/databases" class="external-link" target="_blank">`encode/databases`</a> 为连接数据库提供异步支持(`async` 与 `await`)。
    
    `databases` 兼容以下数据库:
    
    * PostgreSQL
    * MySQL
    * SQLite
    
    本章示例使用 **SQLite**,它使用的是单文件,且 Python 内置集成了 SQLite,因此,可以直接复制并运行本章示例。
    
    生产环境下,则要使用 **PostgreSQL** 等数据库服务器。
    
    !!! tip "提示"
    
    Plain Text
    - Registered: Sun Mar 31 07:19:09 GMT 2024
    - Last Modified: Sat Mar 30 22:44:40 GMT 2024
    - 4.3K bytes
    - Viewed (0)
Back to top