我有一个场景,我需要插入多个记录.我有一个像id(它是来自其他表的fk),key(char),value(char)的表结构.需要保存的输入将是上述数据的数组.示例:我有一些数组对象,如:
lst = [];
obj = {};
obj.id= 123;
obj.key = 'somekey';
obj.value = '1234';
lst.push(obj);
obj = {};
obj.id= 123;
obj.key = 'somekey1';
obj.value = '12345';
lst.push(obj);Run Code Online (Sandbox Code Playgroud)
在MS SQL中,我会创建TVP并通过它.我不知道如何在postgres中实现.所以我现在要做的是使用pg-promise库在postgres sql的单个查询中保存列表中的所有项目.我无法从文档中找到任何文档/理解.任何帮助赞赏.谢谢.
我问的问题是因为我不想使用AzureDirectory项目.我只是在自己尝试一些东西.
cloudStorageAccount = CloudStorageAccount.Parse("DefaultEndpointsProtocol=http;AccountName=xxxx;AccountKey=xxxxx");
blobClient=cloudStorageAccount.CreateCloudBlobClient();
List<CloudBlobContainer> containerList = new List<CloudBlobContainer>();
IEnumerable<CloudBlobContainer> containers = blobClient.ListContainers();
if (containers != null)
{
foreach (var item in containers)
{
Console.WriteLine(item.Uri);
}
}
/* Used to test connectivity
*/
//state the file location of the index
string indexLocation = containers.Last().Name.ToString();
Lucene.Net.Store.Directory dir =
Lucene.Net.Store.FSDirectory.Open(indexLocation);
//create an analyzer to process the text
Lucene.Net.Analysis.Analyzer analyzer = new
Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_30);
//create the index writer with the directory and analyzer defined.
bool findexExists = Lucene.Net.Index.IndexReader.IndexExists(dir);
Lucene.Net.Index.IndexWriter indexWritr = new Lucene.Net.Index.IndexWriter(dir, …Run Code Online (Sandbox Code Playgroud)