Skip to content

Commit 69598b0

Browse files
committed
Update README.md
1 parent 382d671 commit 69598b0

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# SQLC PHP PDO Plugin (Fork)
22

3+
> ⚠️ **Warning:** This project is in a very early stage. Expect bugs and breaking changes. Use with caution in production environments.
4+
35
A fork of the original SQLC plugin, this version generates PHP code using native PDO for type-safe database operations. It allows you to write SQL queries and automatically generates PHP classes with proper type hints and database abstraction, without requiring Doctrine DBAL.
46

57
## Features
@@ -22,12 +24,12 @@ A fork of the original SQLC plugin, this version generates PHP code using native
2224
2. Add the plugin to your `sqlc.yaml` configuration:
2325

2426
```yaml
25-
version: '2'
27+
version: "2"
2628
plugins:
27-
- name: php
28-
wasm:
29-
url: https://github.com/aabajyan/sqlc-gen-php/releases/download/v0.0.3/sqlc-gen-php.wasm
30-
sha256: c54aebed19d5c7961127821c0bac84c8bb00e39d8a0eca05b1710b438e17cbe2
29+
- name: php
30+
wasm:
31+
url: https://github.com/aabajyan/sqlc-gen-php/releases/download/v0.0.15/sqlc-gen-php.wasm
32+
sha256: 950c201f00b8dbe4045c09a206793cc413ff8133c1d5e512b9e57a20427b046a
3133
```
3234
3335
## Configuration
@@ -36,14 +38,14 @@ Configure your SQL queries in `sqlc.yaml`:
3638

3739
```yaml
3840
sql:
39-
- schema: sqlc/authors/mysql/schema.sql
40-
queries: sqlc/authors/mysql/query.sql
41-
engine: mysql # or sqlite
42-
codegen:
43-
- out: src/Sqlc/MySQL
44-
plugin: php
45-
options:
46-
package: "App\\Sqlc\\MySQL" # or your preferred namespace
41+
- schema: sqlc/authors/mysql/schema.sql
42+
queries: sqlc/authors/mysql/query.sql
43+
engine: mysql # or sqlite
44+
codegen:
45+
- out: src/Sqlc/MySQL
46+
plugin: php
47+
options:
48+
package: "App\\Sqlc\\MySQL" # or your preferred namespace
4749
```
4850

4951
Example of a complete `sqlc.yaml` config:
@@ -53,8 +55,8 @@ version: '2'
5355
plugins:
5456
- name: php
5557
wasm:
56-
url: https://github.com/aabajyan/sqlc-gen-php/releases/download/v0.0.3/sqlc-gen-php.wasm
57-
sha256: c54aebed19d5c7961127821c0bac84c8bb00e39d8a0eca05b1710b438e17cbe2
58+
url: https://github.com/aabajyan/sqlc-gen-php/releases/download/v0.0.15/sqlc-gen-php.wasm
59+
sha256: 950c201f00b8dbe4045c09a206793cc413ff8133c1d5e512b9e57a20427b046a
5860
sql:
5961
- schema: sqlc/authors/mysql/schema.sql
6062
queries: sqlc/authors/mysql/query.sql

0 commit comments

Comments
 (0)