You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tag.xo.go
    path of file: ./repos/xo/_examples/django/sqlserver
    
    the code of the file until where you have to start completion: package sqlserver

// Code generated by xo. DO NOT EDIT.

import (
	"context"
)

// Tag represents a row from 'django.tags'.
type Tag struct {
	TagID int64 
    
func (t *Tag) Insert(ctx context.Context, db DB) error {
	switch {
	case t._exists: // already exists
		return logerror(&ErrInsertFailed{ErrAlreadyExists})
	case t._deleted: // deleted
		return logerror(&ErrInsertFailed{ErrMarkedForDeletion})
	}
	// insert (primary key generated and returned by database)
	const sqlstr = `INSERT INTO django.tags (` +
		`tag` +
		`) VALUES (` +
		`@p1` +
		`); SELECT ID = CONVERT(BIGINT, SCOPE_IDENTITY())`
	// run
	logf(sqlstr, t.Tag)
	rows, err := db.QueryContext(ctx, sqlstr, t.Tag)
	if err != nil {
		return logerror(err)
	}
	defer rows.Close()
	// retrieve id
	var id int64
	for rows.Next() {
		if err := rows.Scan(&id); err != nil {
			return logerror(err)
		}
	}
	if err := rows.Err(); err != nil {
		return logerror(err)
	} // set primary key
	t.TagID = int64(id)
	// set exists
	t._exists = true
	return nil
}