func (c *DependsOnSkippedClient) QuerySkipped(dos *DependsOnSkipped) *ImplicitSkippedMessageQuery {
	query := &ImplicitSkippedMessageQuery{config: c.config}
	query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
		id := dos.ID
		step := sqlgraph.NewStep(
			sqlgraph.From(dependsonskipped.Table, dependsonskipped.FieldID, id),
			sqlgraph.To(implicitskippedmessage.Table, implicitskippedmessage.FieldID),
			sqlgraph.Edge(sqlgraph.O2M, false, dependsonskipped.SkippedTable, dependsonskipped.SkippedColumn),
		)
		fromV = sqlgraph.Neighbors(dos.driver.Dialect(), step)
		return fromV, nil
	}
	return query
}
QuerySkipped queries the skipped edge of a DependsOnSkipped.
package ent
import (
	"context"
	"fmt"
	"log"
	"entgo.io/contrib/entproto/internal/entprototest/ent/migrate"
	"github.com/google/uuid"
	"entgo.io/contrib/entproto/internal/entprototest/ent/blogpost"
	"entgo.io/contrib/entproto/internal/entprototest/ent/category"
	"entgo.io/contrib/entproto/internal/entprototest/ent/dependsonskipped"
	"entgo.io/contrib/entproto/internal/entprototest/ent/duplicatenumbermessage"
	"entgo.io/contrib/entproto/internal/entprototest/ent/explicitskippedmessage"
	"entgo.io/contrib/entproto/internal/entprototest/ent/image"
	"entgo.io/contrib/entproto/internal/entprototest/ent/implicitskippedmessage"
	"entgo.io/contrib/entproto/internal/entprototest/ent/invalidfieldmessage"
	"entgo.io/contrib/entproto/internal/entprototest/ent/messagewithenum"
	"entgo.io/contrib/entproto/internal/entprototest/ent/messagewithfieldone"
	"entgo.io/contrib/entproto/internal/entprototest/ent/messagewithid"
	"entgo.io/contrib/entproto/internal/entprototest/ent/messagewithoptionals"
	"entgo.io/contrib/entproto/internal/entprototest/ent/messagewithpackagename"
	"entgo.io/contrib/entproto/internal/entprototest/ent/portal"
	"entgo.io/contrib/entproto/internal/entprototest/ent/user"
	"entgo.io/contrib/entproto/internal/entprototest/ent/validmessage"
	"entgo.io/ent/dialect"
	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
)
type Client struct {
	config
	Schema *migrate.Schema
	BlogPost *BlogPostClient
	Category *CategoryClient
	DependsOnSkipped *DependsOnSkippedClient
	DuplicateNumberMessage *DuplicateNumberMessageClient
	ExplicitSkippedMessage *ExplicitSkippedMessageClient
	Image *ImageClient
	ImplicitSkippedMessage *ImplicitSkippedMessageClient
	InvalidFieldMessage *InvalidFieldMessageClient
	MessageWithEnum *MessageWithEnumClient
	MessageWithFieldOne *MessageWithFieldOneClient
	MessageWithID *MessageWithIDClient
	MessageWithOptionals *MessageWithOptionalsClient
	MessageWithPackageName *MessageWithPackageNameClient
	Portal *PortalClient
	User *UserClient
	ValidMessage *ValidMessageClient
}
func NewClient(opts ...Option) *Client {
	cfg := config{log: log.Println, hooks: &hooks{}}
	cfg.options(opts...)
	client := &Client{config: cfg}
	client.init()
	return client
}
func (c *Client) init() {
	c.Schema = migrate.NewSchema(c.driver)
	c.BlogPost = NewBlogPostClient(c.config)
	c.Category = NewCategoryClient(c.config)
	c.DependsOnSkipped = NewDependsOnSkippedClient(c.config)
	c.DuplicateNumberMessage = NewDuplicateNumberMessageClient(c.config)
	c.ExplicitSkippedMessage = NewExplicitSkippedMessageClient(c.config)
	c.Image = NewImageClient(c.config)
	c.ImplicitSkippedMessage = NewImplicitSkippedMessageClient(c.config)
	c.InvalidFieldMessage = NewInvalidFieldMessageClient(c.config)
	c.MessageWithEnum = NewMessageWithEnumClient(c.config)
	c.MessageWithFieldOne = NewMessageWithFieldOneClient(c.config)
	c.MessageWithID = NewMessageWithIDClient(c.config)
	c.MessageWithOptionals = NewMessageWithOptionalsClient(c.config)
	c.MessageWithPackageName = NewMessageWithPackageNameClient(c.config)
	c.Portal = NewPortalClient(c.config)
	c.User = NewUserClient(c.config)
	c.ValidMessage = NewValidMessageClient(c.config)
}
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
	switch driverName {
	case dialect.MySQL, dialect.Postgres, dialect.SQLite:
		drv, err := sql.Open(driverName, dataSourceName)
		if err != nil {
			return nil, err
		}
		return NewClient(append(options, Driver(drv))...), nil
	default:
		return nil, fmt.Errorf("unsupported driver: %q", driverName)
	}
}
func (c *Client) Tx(ctx context.Context) (*Tx, error) {
	if _, ok := c.driver.(*txDriver); ok {
		return nil, fmt.Errorf("ent: cannot start a transaction within a transaction")
	}
	tx, err := newTx(ctx, c.driver)
	if err != nil {
		return nil, fmt.Errorf("ent: starting a transaction: %w", err)
	}
	cfg := c.config
	cfg.driver = tx
	return &Tx{
		ctx:                    ctx,
		config:                 cfg,
		BlogPost:               NewBlogPostClient(cfg),
		Category:               NewCategoryClient(cfg),
		DependsOnSkipped:       NewDependsOnSkippedClient(cfg),
		DuplicateNumberMessage: NewDuplicateNumberMessageClient(cfg),
		ExplicitSkippedMessage: NewExplicitSkippedMessageClient(cfg),
		Image:                  NewImageClient(cfg),
		ImplicitSkippedMessage: NewImplicitSkippedMessageClient(cfg),
		InvalidFieldMessage:    NewInvalidFieldMessageClient(cfg),
		MessageWithEnum:        NewMessageWithEnumClient(cfg),
		MessageWithFieldOne:    NewMessageWithFieldOneClient(cfg),
		MessageWithID:          NewMessageWithIDClient(cfg),
		MessageWithOptionals:   NewMessageWithOptionalsClient(cfg),
		MessageWithPackageName: NewMessageWithPackageNameClient(cfg),
		Portal:                 NewPortalClient(cfg),
		User:                   NewUserClient(cfg),
		ValidMessage:           NewValidMessageClient(cfg),
	}, nil
}
func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {
	if _, ok := c.driver.(*txDriver); ok {
		return nil, fmt.Errorf("ent: cannot start a transaction within a transaction")
	}
	tx, err := c.driver.(interface {
		BeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)
	}).BeginTx(ctx, opts)
	if err != nil {
		return nil, fmt.Errorf("ent: starting a transaction: %w", err)
	}
	cfg := c.config
	cfg.driver = &txDriver{tx: tx, drv: c.driver}
	return &Tx{
		config:                 cfg,
		BlogPost:               NewBlogPostClient(cfg),
		Category:               NewCategoryClient(cfg),
		DependsOnSkipped:       NewDependsOnSkippedClient(cfg),
		DuplicateNumberMessage: NewDuplicateNumberMessageClient(cfg),
		ExplicitSkippedMessage: NewExplicitSkippedMessageClient(cfg),
		Image:                  NewImageClient(cfg),
		ImplicitSkippedMessage: NewImplicitSkippedMessageClient(cfg),
		InvalidFieldMessage:    NewInvalidFieldMessageClient(cfg),
		MessageWithEnum:        NewMessageWithEnumClient(cfg),
		MessageWithFieldOne:    NewMessageWithFieldOneClient(cfg),
		MessageWithID:          NewMessageWithIDClient(cfg),
		MessageWithOptionals:   NewMessageWithOptionalsClient(cfg),
		MessageWithPackageName: NewMessageWithPackageNameClient(cfg),
		Portal:                 NewPortalClient(cfg),
		User:                   NewUserClient(cfg),
		ValidMessage:           NewValidMessageClient(cfg),
	}, nil
}
func (c *Client) Debug() *Client {
	if c.debug {
		return c
	}
	cfg := c.config
	cfg.driver = dialect.Debug(c.driver, c.log)
	client := &Client{config: cfg}
	client.init()
	return client
}
func (c *Client) Close() error {
	return c.driver.Close()
}
func (c *Client) Use(hooks ...Hook) {
	c.BlogPost.Use(hooks...)
	c.Category.Use(hooks...)
	c.DependsOnSkipped.Use(hooks...)
	c.DuplicateNumberMessage.Use(hooks...)
	c.ExplicitSkippedMessage.Use(hooks...)
	c.Image.Use(hooks...)
	c.ImplicitSkippedMessage.Use(hooks...)
	c.InvalidFieldMessage.Use(hooks...)
	c.MessageWithEnum.Use(hooks...)
	c.MessageWithFieldOne.Use(hooks...)
	c.MessageWithID.Use(hooks...)
	c.MessageWithOptionals.Use(hooks...)
	c.MessageWithPackageName.Use(hooks...)
	c.Portal.Use(hooks...)
	c.User.Use(hooks...)
	c.ValidMessage.Use(hooks...)
}
type BlogPostClient struct {
	config
}
func NewBlogPostClient(c config) *BlogPostClient {
	return &BlogPostClient{config: c}
}
func (c *BlogPostClient) Use(hooks ...Hook) {
	c.hooks.BlogPost = append(c.hooks.BlogPost, hooks...)
}
func (c *BlogPostClient) Create() *BlogPostCreate {
	mutation := newBlogPostMutation(c.config, OpCreate)
	return &BlogPostCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *BlogPostClient) CreateBulk(builders ...*BlogPostCreate) *BlogPostCreateBulk {
	return &BlogPostCreateBulk{config: c.config, builders: builders}
}
func (c *BlogPostClient) Update() *BlogPostUpdate {
	mutation := newBlogPostMutation(c.config, OpUpdate)
	return &BlogPostUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *BlogPostClient) UpdateOne(bp *BlogPost) *BlogPostUpdateOne {
	mutation := newBlogPostMutation(c.config, OpUpdateOne, withBlogPost(bp))
	return &BlogPostUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *BlogPostClient) UpdateOneID(id int) *BlogPostUpdateOne {
	mutation := newBlogPostMutation(c.config, OpUpdateOne, withBlogPostID(id))
	return &BlogPostUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *BlogPostClient) Delete() *BlogPostDelete {
	mutation := newBlogPostMutation(c.config, OpDelete)
	return &BlogPostDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *BlogPostClient) DeleteOne(bp *BlogPost) *BlogPostDeleteOne {
	return c.DeleteOneID(bp.ID)
}
func (c *BlogPostClient) DeleteOneID(id int) *BlogPostDeleteOne {
	builder := c.Delete().Where(blogpost.ID(id))
	builder.mutation.id = &id
	builder.mutation.op = OpDeleteOne
	return &BlogPostDeleteOne{builder}
}
func (c *BlogPostClient) Query() *BlogPostQuery {
	return &BlogPostQuery{
		config: c.config,
	}
}
func (c *BlogPostClient) Get(ctx context.Context, id int) (*BlogPost, error) {
	return c.Query().Where(blogpost.ID(id)).Only(ctx)
}
func (c *BlogPostClient) GetX(ctx context.Context, id int) *BlogPost {
	obj, err := c.Get(ctx, id)
	if err != nil {
		panic(err)
	}
	return obj
}
func (c *BlogPostClient) QueryAuthor(bp *BlogPost) *UserQuery {
	query := &UserQuery{config: c.config}
	query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
		id := bp.ID
		step := sqlgraph.NewStep(
			sqlgraph.From(blogpost.Table, blogpost.FieldID, id),
			sqlgraph.To(user.Table, user.FieldID),
			sqlgraph.Edge(sqlgraph.M2O, false, blogpost.AuthorTable, blogpost.AuthorColumn),
		)
		fromV = sqlgraph.Neighbors(bp.driver.Dialect(), step)
		return fromV, nil
	}
	return query
}
func (c *BlogPostClient) QueryCategories(bp *BlogPost) *CategoryQuery {
	query := &CategoryQuery{config: c.config}
	query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
		id := bp.ID
		step := sqlgraph.NewStep(
			sqlgraph.From(blogpost.Table, blogpost.FieldID, id),
			sqlgraph.To(category.Table, category.FieldID),
			sqlgraph.Edge(sqlgraph.M2M, true, blogpost.CategoriesTable, blogpost.CategoriesPrimaryKey...),
		)
		fromV = sqlgraph.Neighbors(bp.driver.Dialect(), step)
		return fromV, nil
	}
	return query
}
func (c *BlogPostClient) Hooks() []Hook {
	return c.hooks.BlogPost
}
type CategoryClient struct {
	config
}
func NewCategoryClient(c config) *CategoryClient {
	return &CategoryClient{config: c}
}
func (c *CategoryClient) Use(hooks ...Hook) {
	c.hooks.Category = append(c.hooks.Category, hooks...)
}
func (c *CategoryClient) Create() *CategoryCreate {
	mutation := newCategoryMutation(c.config, OpCreate)
	return &CategoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk {
	return &CategoryCreateBulk{config: c.config, builders: builders}
}
func (c *CategoryClient) Update() *CategoryUpdate {
	mutation := newCategoryMutation(c.config, OpUpdate)
	return &CategoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne {
	mutation := newCategoryMutation(c.config, OpUpdateOne, withCategory(ca))
	return &CategoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *CategoryClient) UpdateOneID(id int) *CategoryUpdateOne {
	mutation := newCategoryMutation(c.config, OpUpdateOne, withCategoryID(id))
	return &CategoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *CategoryClient) Delete() *CategoryDelete {
	mutation := newCategoryMutation(c.config, OpDelete)
	return &CategoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne {
	return c.DeleteOneID(ca.ID)
}
func (c *CategoryClient) DeleteOneID(id int) *CategoryDeleteOne {
	builder := c.Delete().Where(category.ID(id))
	builder.mutation.id = &id
	builder.mutation.op = OpDeleteOne
	return &CategoryDeleteOne{builder}
}
func (c *CategoryClient) Query() *CategoryQuery {
	return &CategoryQuery{
		config: c.config,
	}
}
func (c *CategoryClient) Get(ctx context.Context, id int) (*Category, error) {
	return c.Query().Where(category.ID(id)).Only(ctx)
}
func (c *CategoryClient) GetX(ctx context.Context, id int) *Category {
	obj, err := c.Get(ctx, id)
	if err != nil {
		panic(err)
	}
	return obj
}
func (c *CategoryClient) QueryBlogPosts(ca *Category) *BlogPostQuery {
	query := &BlogPostQuery{config: c.config}
	query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
		id := ca.ID
		step := sqlgraph.NewStep(
			sqlgraph.From(category.Table, category.FieldID, id),
			sqlgraph.To(blogpost.Table, blogpost.FieldID),
			sqlgraph.Edge(sqlgraph.M2M, false, category.BlogPostsTable, category.BlogPostsPrimaryKey...),
		)
		fromV = sqlgraph.Neighbors(ca.driver.Dialect(), step)
		return fromV, nil
	}
	return query
}
func (c *CategoryClient) Hooks() []Hook {
	return c.hooks.Category
}
type DependsOnSkippedClient struct {
	config
}
func NewDependsOnSkippedClient(c config) *DependsOnSkippedClient {
	return &DependsOnSkippedClient{config: c}
}
func (c *DependsOnSkippedClient) Use(hooks ...Hook) {
	c.hooks.DependsOnSkipped = append(c.hooks.DependsOnSkipped, hooks...)
}
func (c *DependsOnSkippedClient) Create() *DependsOnSkippedCreate {
	mutation := newDependsOnSkippedMutation(c.config, OpCreate)
	return &DependsOnSkippedCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *DependsOnSkippedClient) CreateBulk(builders ...*DependsOnSkippedCreate) *DependsOnSkippedCreateBulk {
	return &DependsOnSkippedCreateBulk{config: c.config, builders: builders}
}
func (c *DependsOnSkippedClient) Update() *DependsOnSkippedUpdate {
	mutation := newDependsOnSkippedMutation(c.config, OpUpdate)
	return &DependsOnSkippedUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *DependsOnSkippedClient) UpdateOne(dos *DependsOnSkipped) *DependsOnSkippedUpdateOne {
	mutation := newDependsOnSkippedMutation(c.config, OpUpdateOne, withDependsOnSkipped(dos))
	return &DependsOnSkippedUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *DependsOnSkippedClient) UpdateOneID(id int) *DependsOnSkippedUpdateOne {
	mutation := newDependsOnSkippedMutation(c.config, OpUpdateOne, withDependsOnSkippedID(id))
	return &DependsOnSkippedUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *DependsOnSkippedClient) Delete() *DependsOnSkippedDelete {
	mutation := newDependsOnSkippedMutation(c.config, OpDelete)
	return &DependsOnSkippedDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
func (c *DependsOnSkippedClient) DeleteOne(dos *DependsOnSkipped) *DependsOnSkippedDeleteOne {
	return c.DeleteOneID(dos.ID)
}
func (c *DependsOnSkippedClient) DeleteOneID(id int) *DependsOnSkippedDeleteOne {
	builder := c.Delete().Where(dependsonskipped.ID(id))
	builder.mutation.id = &id
	builder.mutation.op = OpDeleteOne
	return &DependsOnSkippedDeleteOne{builder}
}
func (c *DependsOnSkippedClient) Query() *DependsOnSkippedQuery {
	return &DependsOnSkippedQuery{
		config: c.config,
	}
}
func (c *DependsOnSkippedClient) Get(ctx context.Context, id int) (*DependsOnSkipped, error) {
	return c.Query().Where(dependsonskipped.ID(id)).Only(ctx)
}
func (c *DependsOnSkippedClient) GetX(ctx context.Context, id int) *DependsOnSkipped {
	obj, err := c.Get(ctx, id)
	if err != nil {
		panic(err)
	}
	return obj
}