How to implement a SQL-Server IBotDataStore in botframework -
does have example of how implement sql-server ibotdatastore , set used on botframework application?
if possible please provide database schema used on implementation ?
thnks
edit: new blog post has been published how implement ibotdatastore using sql server: https://blog.botframework.com/2017/07/26/saving-state-sql-dotnet/
there sql custom state client implementation here: microsoft.bot.sample.azuresql uses 'code first' , entityframework.
here's script of database:
use [quicksqlexamplebot] go /****** object: table [dbo].[sqlbotdataentities] script date: 7/25/2017 12:15:16 pm ******/ set ansi_nulls on go set quoted_identifier on go create table [dbo].[sqlbotdataentities]( [id] [int] identity(1,1) not null, [botstoretype] [int] not null, [botid] [nvarchar](max) null, [channelid] [nvarchar](200) null, [conversationid] [nvarchar](200) null, [userid] [nvarchar](200) null, [data] [varbinary](max) null, [etag] [nvarchar](max) null, [serviceurl] [nvarchar](max) null, [timestamp] [datetimeoffset](7) not null, constraint [pk_dbo.sqlbotdataentities] primary key clustered ( [id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) ) go set ansi_padding on go /****** object: index [idxstorechannelconversation] script date: 7/25/2017 12:15:18 pm ******/ create nonclustered index [idxstorechannelconversation] on [dbo].[sqlbotdataentities] ( [botstoretype] asc, [channelid] asc, [conversationid] asc )with (pad_index = off, statistics_norecompute = off, sort_in_tempdb = off, drop_existing = off, online = off, allow_row_locks = on, allow_page_locks = on) go set ansi_padding on go /****** object: index [idxstorechannelconversationuser] script date: 7/25/2017 12:15:18 pm ******/ create nonclustered index [idxstorechannelconversationuser] on [dbo].[sqlbotdataentities] ( [botstoretype] asc, [channelid] asc, [conversationid] asc, [userid] asc )with (pad_index = off, statistics_norecompute = off, sort_in_tempdb = off, drop_existing = off, online = off, allow_row_locks = on, allow_page_locks = on) go set ansi_padding on go /****** object: index [idxstorechanneluser] script date: 7/25/2017 12:15:18 pm ******/ create nonclustered index [idxstorechanneluser] on [dbo].[sqlbotdataentities] ( [botstoretype] asc, [channelid] asc, [userid] asc )with (pad_index = off, statistics_norecompute = off, sort_in_tempdb = off, drop_existing = off, online = off, allow_row_locks = on, allow_page_locks = on) go alter table [dbo].[sqlbotdataentities] add default (getutcdate()) [timestamp] go
Comments
Post a Comment