Skip to content

Commit

Permalink
feat(commands): scaffold the db commands
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsimonemms committed Dec 12, 2022
1 parent 5097a00 commit 949920e
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 1 deletion.
30 changes: 30 additions & 0 deletions cmd/db.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright © 2022 Simon Emms <simon@simonemms.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd

import (
"github.com/spf13/cobra"
)

// dbCmd represents the db command
var dbCmd = &cobra.Command{
Use: "db",
Short: "Control the dataset in your database",
}

func init() {
rootCmd.AddCommand(dbCmd)
}
30 changes: 30 additions & 0 deletions cmd/db_mongodb.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright © 2022 Simon Emms <simon@simonemms.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd

import (
"github.com/spf13/cobra"
)

// dbMongodbCmd represents the mongodb command
var dbMongodbCmd = &cobra.Command{
Use: "mongodb",
Short: "MongoDB ingestion commands",
}

func init() {
dbCmd.AddCommand(dbMongodbCmd)
}
30 changes: 30 additions & 0 deletions cmd/db_sql.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright © 2022 Simon Emms <simon@simonemms.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd

import (
"github.com/spf13/cobra"
)

// dbSqlCmd represents the sql command
var dbSqlCmd = &cobra.Command{
Use: "sql",
Short: "SQL ingestion commands",
}

func init() {
dbCmd.AddCommand(dbSqlCmd)
}
30 changes: 30 additions & 0 deletions cmd/db_sql_mysql.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright © 2022 Simon Emms <simon@simonemms.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd

import (
"github.com/spf13/cobra"
)

// dbSqlMysqlCmd represents the mysql command
var dbSqlMysqlCmd = &cobra.Command{
Use: "mysql",
Short: "MySQL ingestion commands",
}

func init() {
dbSqlCmd.AddCommand(dbSqlMysqlCmd)
}
30 changes: 30 additions & 0 deletions cmd/db_sql_postgres.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright © 2022 Simon Emms <simon@simonemms.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd

import (
"github.com/spf13/cobra"
)

// dbSqlPostgresCmd represents the postgres command
var dbSqlPostgresCmd = &cobra.Command{
Use: "postgres",
Short: "PostgreSQL ingestion commands",
}

func init() {
dbSqlCmd.AddCommand(dbSqlPostgresCmd)
}
30 changes: 30 additions & 0 deletions cmd/db_sql_sqlite.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright © 2022 Simon Emms <simon@simonemms.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd

import (
"github.com/spf13/cobra"
)

// dbSqlSqliteCmd represents the sqlite command
var dbSqlSqliteCmd = &cobra.Command{
Use: "sqlite",
Short: "SQLite ingestion commands",
}

func init() {
dbSqlCmd.AddCommand(dbSqlSqliteCmd)
}
30 changes: 30 additions & 0 deletions cmd/db_sql_sqlserver.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright © 2022 Simon Emms <simon@simonemms.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd

import (
"github.com/spf13/cobra"
)

// dbSqlSqlserverCmd represents the sqlserver command
var dbSqlSqlserverCmd = &cobra.Command{
Use: "sqlserver",
Short: "SQL server ingestion commands",
}

func init() {
dbSqlCmd.AddCommand(dbSqlSqlserverCmd)
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down

0 comments on commit 949920e

Please sign in to comment.