@@ -4,12 +4,15 @@ import (
4
4
"context"
5
5
"errors"
6
6
"fmt"
7
+ "github.com/IvanOfThings/terraform-provider-clickhouse/pkg/resources/db"
8
+ "github.com/IvanOfThings/terraform-provider-clickhouse/pkg/resources/role"
9
+ "github.com/IvanOfThings/terraform-provider-clickhouse/pkg/resources/table"
10
+ "github.com/IvanOfThings/terraform-provider-clickhouse/pkg/resources/user"
7
11
"net/url"
8
12
"os"
9
13
10
14
"github.com/IvanOfThings/terraform-provider-clickhouse/pkg/common"
11
15
"github.com/IvanOfThings/terraform-provider-clickhouse/pkg/datasources"
12
- "github.com/IvanOfThings/terraform-provider-clickhouse/pkg/resources"
13
16
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
14
17
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
15
18
"github.com/joho/godotenv"
@@ -84,13 +87,14 @@ func New(version string) func() *schema.Provider {
84
87
"clickhouse_dbs" : datasources .DataSourceDbs (),
85
88
},
86
89
ResourcesMap : map [string ]* schema.Resource {
87
- "clickhouse_db" : resources .ResourceDb (),
88
- "clickhouse_table" : resources .ResourceTable (),
90
+ "clickhouse_db" : resourcedb .ResourceDb (),
91
+ "clickhouse_table" : resourcetable .ResourceTable (),
92
+ "clickhouse_role" : resourcerole .ResourceRole (),
93
+ "clickhouse_user" : resourceuser .ResourceUser (),
89
94
},
95
+ ConfigureContextFunc : configure (),
90
96
}
91
97
92
- p .ConfigureContextFunc = configure (version , p )
93
-
94
98
return p
95
99
}
96
100
}
@@ -105,7 +109,7 @@ func getEnvVar(envVarName string) (any, error) {
105
109
106
110
}
107
111
108
- func configure (version string , p * schema. Provider ) func (context.Context , * schema.ResourceData ) (any , diag.Diagnostics ) {
112
+ func configure () func (context.Context , * schema.ResourceData ) (any , diag.Diagnostics ) {
109
113
return func (ctx context.Context , d * schema.ResourceData ) (any , diag.Diagnostics ) {
110
114
111
115
clickhouseUrl := d .Get ("host" ).(string )
0 commit comments