@@ -19,14 +19,34 @@ const (
1919 sysTable = ".sys"
2020)
2121
22+ type dbNamer interface {
23+ Name () string
24+ }
25+
26+ type dbSchemer interface {
27+ Scheme () scheme.Client
28+ }
29+
30+ type dbTabler interface {
31+ Table () table.Client
32+ }
33+
34+ type dbForMakeRecursive interface {
35+ dbNamer
36+ dbSchemer
37+ }
38+
39+ type dbFoRemoveRecursive interface {
40+ dbNamer
41+ dbSchemer
42+ dbTabler
43+ }
44+
2245// MakeRecursive creates path inside database
2346// pathToCreate is a database root relative path
2447// MakeRecursive method equal bash command `mkdir -p ~/path/to/create`
2548// where `~` - is a root of database
26- //
27- // Use deprecated ydb.Connection as param for backward compatibility
28- // Usually use *ydb.Driver, that implement ydb.Connection
29- func MakeRecursive (ctx context.Context , db ydb.Connection , pathToCreate string ) error { //nolint:staticcheck
49+ func MakeRecursive (ctx context.Context , db dbForMakeRecursive , pathToCreate string ) error {
3050 pathToCreate = path .Join (db .Name (), pathToCreate )
3151 for i := len (db .Name ()) + 1 ; i < len (pathToCreate ); i ++ {
3252 x := strings .IndexByte (pathToCreate [i :], '/' )
@@ -81,10 +101,7 @@ func MakeRecursive(ctx context.Context, db ydb.Connection, pathToCreate string)
81101// Empty prefix means than use root of database.
82102// RemoveRecursive method equal bash command `rm -rf ~/path/to/remove`
83103// where `~` - is a root of database
84- //
85- // Use deprecated ydb.Connection as param for backward compatibility
86- // Usually use *ydb.Driver, that implement ydb.Connection
87- func RemoveRecursive (ctx context.Context , db ydb.Connection , pathToRemove string ) error { //nolint:staticcheck
104+ func RemoveRecursive (ctx context.Context , db dbFoRemoveRecursive , pathToRemove string ) error {
88105 fullSysTablePath := path .Join (db .Name (), sysTable )
89106 var list func (int , string ) error
90107 list = func (i int , p string ) error {
0 commit comments