修改接口
This commit is contained in:
		
							
								
								
									
										28
									
								
								FutureMailAPI/TestDB.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								FutureMailAPI/TestDB.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
using Microsoft.Data.Sqlite;
 | 
			
		||||
using System;
 | 
			
		||||
 | 
			
		||||
namespace TestDB
 | 
			
		||||
{
 | 
			
		||||
    class Program
 | 
			
		||||
    {
 | 
			
		||||
        static void Main(string[] args)
 | 
			
		||||
        {
 | 
			
		||||
            using (var connection = new SqliteConnection("Data Source=FutureMail.db"))
 | 
			
		||||
            {
 | 
			
		||||
                connection.Open();
 | 
			
		||||
                
 | 
			
		||||
                var command = connection.CreateCommand();
 | 
			
		||||
                command.CommandText = "PRAGMA table_info(Users)";
 | 
			
		||||
                
 | 
			
		||||
                using (var reader = command.ExecuteReader())
 | 
			
		||||
                {
 | 
			
		||||
                    Console.WriteLine("Users表结构:");
 | 
			
		||||
                    while (reader.Read())
 | 
			
		||||
                    {
 | 
			
		||||
                        Console.WriteLine($"列名: {reader[1]}, 类型: {reader[2]}, 是否非空: {reader[3]}, 默认值: {reader[4]}, 主键: {reader[5]}");
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user