Skip to content

Commit 9ed7dcb

Browse files
authored
Merge pull request #9 from Daffadon/dev
Feat: add Clickhouse to DB option, issue template, and v0.4.0 release
2 parents 93eb736 + b8f7b2c commit 9ed7dcb

14 files changed

Lines changed: 135 additions & 12 deletions

File tree

.github/workflows/releaser.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
tags:
66
- 'v*' # only run when a tag starting with "v" is pushed (e.g., v1.0.0)
7-
branches:
8-
- main # only on main branch
97

108
permissions:
119
contents: write # required for creating GitHub Releases

.goreleaser.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ changelog:
5555
exclude:
5656
- "^docs:"
5757
- "^test:"
58-
- Merge pull request
5958

6059
release:
6160
footer: >-

README.MD

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ Bootstrap your Go projects with clean architecture, best practices, and a solid
1818
---
1919

2020
> [!NOTE]
21-
> v0.3.2 now is stable, latest version, and generating one set of application with its driver to 3rd party. in this version, you can generate different framework, database, and message queue.
21+
> v0.4.0 now is stable, latest version, and generating one set of application with its driver to 3rd party. in this version, you can generate different framework, database, and message queue.
2222
2323
## 🔥 Get started
2424

2525
```bash
26-
go run github.com/daffadon/fndn@v0.3.2 init .
26+
go run github.com/daffadon/fndn@v0.4.0 init .
2727
```
2828

2929
\* . generate in current directory
3030

3131
OR
3232

3333
```bash
34-
go run github.com/daffadon/fndn@v0.3.2 --help
34+
go run github.com/daffadon/fndn@v0.4.0 --help
3535
```
3636

3737
to see how can you use the tools
@@ -44,12 +44,12 @@ to see how can you use the tools
4444
If you want to install the tools to your system, you can either using go install or download the binary in available release:
4545

4646
```bash
47-
go install github.com/daffadon/fndn@v0.3.2
47+
go install github.com/daffadon/fndn@v0.4.0
4848
```
4949

5050
## 🛠️ The techstack
5151

52-
Currently, the generation are in default mode and custom mode with limitation at `framework` and `database`. the `Default` mode is using the first techstack from each section. the generated techstack that you can use are:
52+
Currently, the generation are in default mode and custom mode with limitation at `framework`, `database`, and `message queue`. the `Default` mode is using the first techstack from each section. the generated techstack that you can use are:
5353

5454
- Framework
5555

@@ -63,6 +63,7 @@ Currently, the generation are in default mode and custom mode with limitation at
6363

6464
![Postgresql](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white)
6565
![MariaDB](https://img.shields.io/badge/MariaDB-003545?style=for-the-badge&logo=mariadb&logoColor=white)
66+
![ClickHouse](https://img.shields.io/badge/ClickHouse-FFCC01?style=for-the-badge&logo=ClickHouse&logoColor=white)
6667
![MongoDB](https://img.shields.io/badge/MongoDB-%234ea94b.svg?style=for-the-badge&logo=mongodb&logoColor=white)
6768
![FerretDB](https://img.shields.io/badge/FerretDB-black?style=for-the-badge&logo=ferretdb&logoColor=white)
6869
![Neo4J](https://img.shields.io/badge/Neo4j-008CC1?style=for-the-badge&logo=neo4j&logoColor=white)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.3.2
1+
v0.4.0

internal/domain/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ func InitYamlConfig(i infra.CommandRunner, p *Project) error {
3535
s += config_template.PostresqlYamlConfigTemplate
3636
case "mariadb":
3737
s += config_template.MariaDBYamlConfigTemplate
38+
case "clickhouse":
39+
s += config_template.ClickHouseYamlConfigTemplate
3840
case "mongodb":
3941
s += config_template.MongoDBYamlConfigTemplate
4042
case "ferretdb":

internal/domain/database.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ func InitDBConfig(i infra.CommandRunner, path *string, db *string) error {
2020
case "mariadb":
2121
fileName = folderName + "/mariadb.go"
2222
template = database_template.MariaDBConfigTemplate
23+
case "clickhouse":
24+
fileName = folderName + "/clickhouse.go"
25+
template = database_template.ClickHouseConfigTemplate
2326
case "mongodb":
2427
fileName = folderName + "/mongodb.go"
2528
template = database_template.MongoDBConfigTemplate

internal/domain/docker.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ func InitDockerComposeConfig(i infra.CommandRunner, p *Project) error {
5656
dbDockerTemplate = database_template.DockerComposePostgresqlConfigTemplate
5757
case "mariadb":
5858
dbDockerTemplate = database_template.DockerComposeMariaDBConfigTemplate
59+
case "clickhouse":
60+
dbDockerTemplate = database_template.DockerComposeClickHouseConfigTemplate
5961
case "mongodb":
6062
dbDockerTemplate = database_template.DockerComposeMongoDBConfigTemplate
6163
case "ferretdb":

internal/domain/infra.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ func InitQuerierInfra(i infra.CommandRunner, path *string, database *string) err
1919
s = infra_template.QuerierPgxInfraTemplate
2020
case "mariadb":
2121
s = infra_template.QuerierMariaDBInfraTemplate
22+
case "clickhouse":
23+
s = infra_template.QuerierClickHouseInfraTemplate
2224
case "mongodb", "ferretdb":
2325
st := struct{ DatabaseName string }{DatabaseName: "database_name"}
2426
tmp, err := pkg.ParseTemplate(infra_template.QuerierMongoDBInfraTemplate, st)

internal/domain/main-gen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func InitDependencyInjection(i infra.CommandRunner, p *Project) error {
1919
MQInfra string
2020
}
2121
switch p.Database {
22-
case "postgresql", "mariadb":
22+
case "postgresql", "mariadb", "clickhouse":
2323
st.DBConnection = "NewSQLConn"
2424
case "neo4j":
2525
st.DBConnection = "NewGraphDBConn"

internal/pkg/parser.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ func HTTPServerParser(fwk, db, mq string) (string, error) {
5656
t.DBInstanceType = "*sql.DB"
5757
t.DBCloseConnection = "db.Close()"
5858
t.DBImport = `"database/sql"`
59+
case "clickhouse":
60+
t.DBInstanceType = "clickhouse.Conn"
61+
t.DBCloseConnection = "db.Close()"
62+
t.DBImport = `"github.com/ClickHouse/clickhouse-go/v2"`
5963
case "mongodb", "ferretdb":
6064
t.DBInstanceType = "*mongo.Client"
6165
t.DBCloseConnection = "db.Disconnect(ctx)"

0 commit comments

Comments
 (0)