Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functionality and Optimization updates #2

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
6b0e024
Update library to .Net CLR 4.0, VisualStudio 2012, enhance error repo…
Oct 4, 2014
91b40b1
Forgot to include one file in the .Net 4 upgrade commit, also add in …
Oct 4, 2014
e36a03d
Optimization changes: make it so that QTable.AcceptChanges does not s…
Oct 4, 2014
8cb7b7f
Handle lookup columns (identify them, and don't include them in uploa…
Oct 8, 2014
8cee7a2
Separate internal (QBformat) values from what an application can grab…
Oct 9, 2014
1847a8c
Previous work on separating user view of data vs QBase view was flawe…
Oct 13, 2014
b862b56
Convert all record results to the client to be a corresponding .NET t…
Oct 27, 2014
8e700e7
Fix improperly implemented duration field
Dec 1, 2014
5ef21de
Fix datetime handling, fix column indexing for records not downloaded…
Apr 9, 2015
9d1b5f8
Fix handling of duration field
Apr 10, 2015
70fd301
Fix DateTime handling so it properly round-trips from any local timez…
Dec 18, 2015
da0ee79
Refix DateTime: it appears that with the functions we are using, the …
Dec 18, 2015
4fa15be
Implement the beginnings of unit tests (table creation, round trip te…
Jul 19, 2016
d997a59
Start getting file uploads to work, make sure testable values round t…
Aug 18, 2016
5dcac93
Fix updating a field to actually check before marking a record dirty,…
Aug 30, 2016
246c59e
Remove dead code changed by last patch
Aug 30, 2016
0e954bd
Remove a lot of 'homegrown' xml formation/creation and use System.Xml…
Oct 5, 2016
ed1ca16
Clean up some in-progress code from the last commit, fix a problem th…
Oct 5, 2016
5fa5dfc
Code cleanups for readability, bugfix: add in check to allow updating…
Oct 12, 2016
19c988f
Alter QTable _doQuery to automatically handle ViewTooLarge exceptions…
Nov 6, 2016
e397ca8
Complete previous change to DoQuery
Nov 8, 2016
610e70f
updated code to enable connections with usertoken, in addition to use…
michaelgeary Nov 14, 2016
cb1a8a9
Add test for big table handling, correct a CSV quoting issue, change …
Dec 30, 2016
2dd83f9
Implement QRecordCollection.RemoveAt for optimized processing
Apr 18, 2017
f9aebd9
Start work on adding optimizaions for deletion and handling larger ta…
Apr 19, 2017
906a2ae
Fix confusion with column indexes vs column ids (QuickBase is not zer…
Apr 21, 2017
0e75595
Merge branch 'master' of https://github.com/jherig/QuickBase-C-Sharp-SDK
Apr 21, 2017
5223658
Missed stuff in the merge
Apr 21, 2017
c92f4d6
Eficiently get around CSV upload bug involving text fields with CR or…
Apr 28, 2017
4e245db
Handle the case of no updates properly, handle cases where the record…
May 1, 2017
427e3ff
First stab at handling the errorcode 77 (API request limit exceeded) …
May 3, 2017
083b711
Cleanups, change to HTML1.1 for queries, remove a required roundtrip …
May 30, 2018
98309b2
Fixed date, timestamp and timeofday conversions and tested. Added ha…
Jun 1, 2018
f377727
Unit test for duration. Currently fails due to problem with API, repo…
Jul 19, 2018
1b66c79
Remove all handmade xml and xpath in favor of using linq-to-xml to ma…
Jul 22, 2018
9c5e079
Merge branch 'master' of https://github.com/jherig/QuickBase-C-Sharp-SDK
Jul 22, 2018
ec3441d
Update to .Net Framework 4.6.1 to handle upcoming removal of support …
Oct 12, 2018
dc93c77
Forgot to stage all these to previous commit: continuation of .Net 4.…
Oct 12, 2018
1bc729a
Add in lazy loading for tables to speed up app start up and reduce AP…
Apr 16, 2019
5349bac
Support 'multitext' fields at least for receiving, prevent setting fi…
Feb 3, 2021
9fa6414
Complete support for Summary and Virtual fields, fix bug in code for …
Feb 8, 2021
6e2313e
Code cleanup, switch to updated nuget code analysis from Microsoft as…
Nov 24, 2021
267b009
forgot to push this file too
Nov 24, 2021
81f172d
Merge branch 'master' of https://github.com/michaelgeary/QuickBase-C-…
Dec 2, 2021
dea0c15
Remove usage of 'var' (improves readability in my opinion), fix a per…
Mar 24, 2022
21cd8ae
Correct for bad test/possible failures in large deletion scenarios
Mar 25, 2022
42fc807
Fix option lists when there are large numbers downloaded from QB, add…
May 31, 2022
5d9170a
Fix exceptions to match best practices and serialize properly
Mar 23, 2023
5914140
Cleanup of Exceptions, fix deletion to clean up XML reads back from s…
Mar 23, 2023
1dfc7d0
Coorect for Date objects being sent in UTC only, not in local timezone.
Oct 6, 2023
18c6185
Update multitext support and fix, add error messaging for missing tables
Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
; Top-most EditorConfig file
root = true

; 4-column space indentation
[*.cs]
indent_style = space
indent_size = 4
tab_width = 4
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
.svn
.svn/
.vs/
*/obj/
*/bin/
**/packages/
QBFunctionTest/TestConfigs.xml
TestResults/
*.CodeAnalysisLog.xml
*.ruleset
*.lastcodeanalysissucceeded
*.suo
*.cache
*.orig
*.bak
/License.log
/Intuit.QuickBase.sln.DotSettings.user
10 changes: 9 additions & 1 deletion Intuit.QuickBase.Client/ComparisonOperator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ public enum ComparisonOperator
///<summary>
/// Is greater than or equal to
///</summary>
GTE
GTE,
/// <summary>
/// Is in range
/// </summary>
IR,
/// <summary>
/// Is not in range
/// </summary>
XIR
}
}
4 changes: 2 additions & 2 deletions Intuit.QuickBase.Client/IQApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* http://www.opensource.org/licenses/eclipse-1.0.php
*/
using System.Collections.Generic;
using System.Xml.XPath;
using System.Xml.Linq;

namespace Intuit.QuickBase.Client
{
Expand All @@ -18,7 +18,7 @@ public interface IQApplication
IQClient Client { get; }
void Disconnect();
AppInfo GetApplicationInfo();
XPathDocument GetApplicationSchema();
XElement GetApplicationSchema();
string CloneApplication(string qbNewName, string qbNewDescription, CloneData cloneData);
void RenameApplication(string qbNewName);
void DeleteApplication();
Expand Down
20 changes: 20 additions & 0 deletions Intuit.QuickBase.Client/IQColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.opensource.org/licenses/eclipse-1.0.php
*/

using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Security.AccessControl;
using Intuit.QuickBase.Core;

namespace Intuit.QuickBase.Client
Expand All @@ -14,9 +18,25 @@ public interface IQColumn
int ColumnId { get; set; }
string ColumnName { get; set; }
FieldType ColumnType { get; set; }
bool ColumnVirtual { get; set; }
bool ColumnSummary { get; set; }
bool IsHidden { get; set; }
bool ColumnLookup { get; set; }
bool AllowHTML { get; set; }
bool CanAddChoices { get; set; }
string CurrencySymbol { get; set; }
bool Equals(IQColumn column);
bool Equals(object obj);
int GetHashCode();
string ToString();
List<object> GetChoices();
void AddChoice(object obj);
}

internal interface IQColumn_int
{
void AcceptChanges(IQApplication Application, string tbid);
void AddChoice(object obj, bool onServer);
Dictionary<string,int> GetComposites();
}
}
14 changes: 12 additions & 2 deletions Intuit.QuickBase.Client/IQRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,25 @@ public interface IQRecord
{
int RecordId { get; }
RecordState RecordState { get; }
bool UncleanState { get; }
bool IsOnServer { get; }
string this[int index] { get; set; }
string this[string columnName] { get; set; }
object this[int index] { get; set; }
object this[string columnName] { get; set; }
void AcceptChanges();
void UploadFile(string columnName, string filePath);
void DownloadFile(string columnName, string path, int versionId);
void ChangeOwnerTo(string newOwner);
string GetAsCSV(string clist);
bool Equals(IQRecord record);
bool Equals(object obj);
int GetHashCode();
string ToString();
}

internal interface IQRecord_int
{
void ForceUpdateState(int recId);
void ForceUpdateState();
int GetColumnIndex(string colName);
}
}
32 changes: 22 additions & 10 deletions Intuit.QuickBase.Client/IQTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,47 @@
* which accompanies this distribution, and is available at
* http://www.opensource.org/licenses/eclipse-1.0.php
*/
using System.Xml.XPath;
using System.Xml.Linq;

namespace Intuit.QuickBase.Client
{
public interface IQTable
{
string TableName { get; }
string TableId { get; }
int KeyFID { get; }
int KeyCIdx { get; }
QRecordCollection Records { get; }
QColumnCollection Columns { get; }
void Clear();
string GenCsv();
string GenCsv(int queryId);
XPathDocument GetTableSchema();
string GenCsv(Query query);
string GenHtml(string options = "", string colList = "a");
string GenHtml(int queryId, string options = "", string colList = "a");
string GenHtml(Query query, string options = "", string colList = "a");
XElement GetTableSchema();
TableInfo GetTableInfo();
int GetServerRecordCount();
void Query();
void Query(int[] clist);
void Query(int[] clist, string options);
void Query(Query query);
void Query(Query query, int[] clist);
void Query(Query query, int[] clist, int[] slist);
void Query(Query query, int[] clist, int[] slist, string options);
void Query(int queryId);
void Query(bool clearRecords = true);
void Query(string options, bool clearRecords = true);
void Query(int[] colList, bool clearRecords = true);
void Query(int[] colList, string options, bool clearRecords = true);
void Query(Query query, bool clearRecords = true);
void Query(Query query, string options, bool clearRecords = true);
void Query(Query query, int[] colList, bool clearRecords = true);
void Query(Query query, int[] colList, int[] sortList, bool clearRecords = true);
void Query(Query query, int[] colList, int[] sortList, string options, bool clearRecords = true);
void Query(int queryId, bool clearRecords = true);
void Query(int queryId, string options, bool clearRecords = true);
int QueryCount(Query query);
int QueryCount(int queryId);
void PurgeRecords();
void PurgeRecords(int queryId);
void PurgeRecords(Query query);
void AcceptChanges();
IQRecord NewRecord();
void RefreshColumns();
string ToString();
}
}
36 changes: 34 additions & 2 deletions Intuit.QuickBase.Client/Intuit.QuickBase.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.props" Condition="Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,12 +11,21 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Intuit.QuickBase.Client</RootNamespace>
<AssemblyName>Intuit.QuickBase.Client</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -25,6 +35,9 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>false</RunCodeAnalysis>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -33,8 +46,11 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet />
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
Expand Down Expand Up @@ -64,6 +80,7 @@
<Compile Include="IQTable.cs" />
<Compile Include="LogicalOperator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="QAddress.cs" />
<Compile Include="QApplication.cs" />
<Compile Include="QApplicationFactory.cs" />
<Compile Include="QApplicationFactoryBase.cs" />
Expand Down Expand Up @@ -100,7 +117,22 @@
<Name>Intuit.QuickBase.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll" />
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.NetAnalyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.targets" Condition="Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
26 changes: 26 additions & 0 deletions Intuit.QuickBase.Client/QAddress.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace Intuit.QuickBase.Client
{
public class QAddress
{
public string Line1 { get; set; }
public string Line2 { get; set; }
public string City { get; set; }
public string Province { get; set; }
public string PostalCode { get; set; }
public string Country { get; set; }

public QAddress(string line1, string line2, string city, string province, string postCode, string country)
{
Line1 = line1;
Line2 = line2;
City = city;
Province = province;
PostalCode = postCode;
Country = country;
}

public QAddress()
{
}
}
}
Loading